hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3822b069ee64df66a75ee6dfa970295d128aba | 23,556 | py | Python | bl3save/cli_prof_edit.py | DataCluster0/wonderlands-cli-saveedit | 91c7cf30289d62b5d51963da39f80d85c8cb97c5 | [
"Zlib"
] | 78 | 2020-04-05T19:49:31.000Z | 2022-03-09T10:01:40.000Z | bl3save/cli_prof_edit.py | DataCluster0/wonderlands-cli-saveedit | 91c7cf30289d62b5d51963da39f80d85c8cb97c5 | [
"Zlib"
] | 24 | 2020-04-10T16:22:09.000Z | 2022-03-26T11:46:55.000Z | bl3save/cli_prof_edit.py | DataCluster0/wonderlands-cli-saveedit | 91c7cf30289d62b5d51963da39f80d85c8cb97c5 | [
"Zlib"
] | 19 | 2020-04-10T17:32:56.000Z | 2022-03-27T22:23:05.000Z | #!/usr/bin/env python3
# vim: set expandtab tabstop=4 shiftwidth=4:
# Copyright (c) 2020-2021 CJ Kucera (cj@apocalyptech.com)
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from
# the use of this software.
#
# Perm... | 38.616393 | 124 | 0.598022 |
import os
import sys
import bl3save
import argparse
from . import cli_common
from bl3save.bl3profile import BL3Profile
def main():
parser = argparse.ArgumentParser(
description='Borderlands 3 CLI Profile Editor v{} (PC Only)'.format(bl3save.__version__),
formatter_class=argparse.Argu... | true | true |
1c3822d343c152c3c84298afdba5a208cab24a5a | 62,879 | py | Python | src/pretix/api/serializers/order.py | fakegit/pretix | b6e9e64ff967f7b4f91fe88694f4157d8a0787b4 | [
"Apache-2.0"
] | null | null | null | src/pretix/api/serializers/order.py | fakegit/pretix | b6e9e64ff967f7b4f91fe88694f4157d8a0787b4 | [
"Apache-2.0"
] | 56 | 2020-05-07T07:54:17.000Z | 2021-04-19T12:14:14.000Z | src/pretix/api/serializers/order.py | fakegit/pretix | b6e9e64ff967f7b4f91fe88694f4157d8a0787b4 | [
"Apache-2.0"
] | null | null | null | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by ... | 43.63567 | 160 | 0.571908 | import json
from collections import Counter, defaultdict
from decimal import Decimal
import pycountry
from django.core.files import File
from django.db.models import F, Q
from django.utils.timezone import now
from django.utils.translation import gettext_lazy
from django_countries.fields import Country
from rest_framew... | true | true |
1c3822e9820d11b876c263fd47b55ca874718491 | 876 | py | Python | tinypipe/utils/general.py | dave-msk/tinypipe | 0be1c3cafb2a1cb2f672e4688e84889fa52dad30 | [
"Apache-2.0"
] | null | null | null | tinypipe/utils/general.py | dave-msk/tinypipe | 0be1c3cafb2a1cb2f672e4688e84889fa52dad30 | [
"Apache-2.0"
] | null | null | null | tinypipe/utils/general.py | dave-msk/tinypipe | 0be1c3cafb2a1cb2f672e4688e84889fa52dad30 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Siu-Kei Muk (David). All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 39.818182 | 80 | 0.705479 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def val_or_default(val, default):
return val if val is not None else default
| true | true |
1c3823c76dbf00f9fce4c4498a7bed366e31e3ef | 90 | py | Python | cms/__init__.py | fp4code/django-cms | e382fc7fe039733fee187658066a7b4af656c49e | [
"BSD-3-Clause"
] | 1 | 2019-09-14T09:45:12.000Z | 2019-09-14T09:45:12.000Z | cms/__init__.py | zahedbri/django-cms | 70c11c90d14459ef63472f3d0e6c90086c6098c5 | [
"BSD-3-Clause"
] | null | null | null | cms/__init__.py | zahedbri/django-cms | 70c11c90d14459ef63472f3d0e6c90086c6098c5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = '3.4.5'
default_app_config = 'cms.apps.CMSConfig'
| 15 | 41 | 0.644444 |
__version__ = '3.4.5'
default_app_config = 'cms.apps.CMSConfig'
| true | true |
1c3823cc1f57943e9f990aa7d2ac42167d0e0e23 | 4,779 | py | Python | composition_root.py | plievana/python-ddd | 44b1932344260b33ee0cce538c0be0b56b21327d | [
"MIT"
] | null | null | null | composition_root.py | plievana/python-ddd | 44b1932344260b33ee0cce538c0be0b56b21327d | [
"MIT"
] | null | null | null | composition_root.py | plievana/python-ddd | 44b1932344260b33ee0cce538c0be0b56b21327d | [
"MIT"
] | null | null | null | import dependency_injector.containers as containers
import dependency_injector.providers as providers
from application.command_bus import CommandBus
from application.command_handlers import AddItemCommandHandler
from application.query_bus import QueryBus
from application.query_handlers import GetItemsQueryHandler
from... | 51.387097 | 162 | 0.642394 | import dependency_injector.containers as containers
import dependency_injector.providers as providers
from application.command_bus import CommandBus
from application.command_handlers import AddItemCommandHandler
from application.query_bus import QueryBus
from application.query_handlers import GetItemsQueryHandler
from... | true | true |
1c3823cef3b0698023be0f415936f0db8a9d85de | 2,198 | py | Python | qpricesim/model_code/economic_environment.py | ToFeWe/qpricesim | 2d4312ed1d1356449f0c168835a0662b238a27bb | [
"MIT"
] | 2 | 2022-03-22T12:16:37.000Z | 2022-03-22T12:48:46.000Z | qpricesim/model_code/economic_environment.py | ToFeWe/qpricesim | 2d4312ed1d1356449f0c168835a0662b238a27bb | [
"MIT"
] | null | null | null | qpricesim/model_code/economic_environment.py | ToFeWe/qpricesim | 2d4312ed1d1356449f0c168835a0662b238a27bb | [
"MIT"
] | null | null | null | """
A module that defines the economic environment the agents are interacting in.
"""
import numpy as np
from numba import njit
@njit
def calc_winning_price(all_prices):
"""
Helper function that takes in the array of all prices in the market
and returns the winning price and the number of firms that pick... | 32.80597 | 86 | 0.696087 | import numpy as np
from numba import njit
@njit
def calc_winning_price(all_prices):
winning_price = np.min(all_prices)
n_winning_price = np.sum(np.where(all_prices == winning_price, 1, 0))
return winning_price, n_winning_price
@njit
def calc_reward(p_i, winning_price, n_winning_price, reser... | true | true |
1c3824dda1e45856c1c591405392e5f8ca1dd8b1 | 8,686 | py | Python | dosna/backends/s3.py | ijjorama/DosNa | 8e5322a0e1b93a377a9a443d442253b45957dac2 | [
"Apache-2.0"
] | null | null | null | dosna/backends/s3.py | ijjorama/DosNa | 8e5322a0e1b93a377a9a443d442253b45957dac2 | [
"Apache-2.0"
] | null | null | null | dosna/backends/s3.py | ijjorama/DosNa | 8e5322a0e1b93a377a9a443d442253b45957dac2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Backend s3 uses a S3 interface to store the dataset and chunks data"""
import logging
import numpy as np
import boto3
from botocore.exceptions import ClientError
from dosna.backends import Backend
from dosna.backends.base import (BackendConnection, BackendDataChunk,
... | 29.544218 | 79 | 0.590145 |
import logging
import numpy as np
import boto3
from botocore.exceptions import ClientError
from dosna.backends import Backend
from dosna.backends.base import (BackendConnection, BackendDataChunk,
BackendDataset, ConnectionError,
DatasetNotFoundError)
... | true | true |
1c3825a7c22eda2611ef396149cf33214f4ab6ae | 8,509 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/18-2Nested_false-termination_5.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/18-2Nested_false-termination_5.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/18-2Nested_false-termination_5.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 31.75 | 77 | 0.590786 | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
1c38271b2f5390e82710ce248c2a449c33d2bc3e | 1,659 | py | Python | src/genie/libs/parser/iosxe/tests/ShowLispInstanceIdIpv4MapCache/cli/equal/golden_output6_metric_expected.py | nielsvanhooy/genieparser | 9a1955749697a6777ca614f0af4d5f3a2c254ccd | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowLispInstanceIdIpv4MapCache/cli/equal/golden_output6_metric_expected.py | nielsvanhooy/genieparser | 9a1955749697a6777ca614f0af4d5f3a2c254ccd | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxe/tests/ShowLispInstanceIdIpv4MapCache/cli/equal/golden_output6_metric_expected.py | nielsvanhooy/genieparser | 9a1955749697a6777ca614f0af4d5f3a2c254ccd | [
"Apache-2.0"
] | null | null | null | expected_output = {
'lisp_id': {
0: {
'instance_id': {
111: {
'eid_prefix': {
'0.0.0.0/0': {
'action': 'send-map-request + Encapsulating to proxy ETR',
'expiry_time': '00:1... | 41.475 | 87 | 0.221218 | expected_output = {
'lisp_id': {
0: {
'instance_id': {
111: {
'eid_prefix': {
'0.0.0.0/0': {
'action': 'send-map-request + Encapsulating to proxy ETR',
'expiry_time': '00:1... | true | true |
1c382759860b98ee6972f4f10fd270f3d5268410 | 665 | py | Python | nnabla_nas/optimizer/__init__.py | sony/nnabla-nas | 269deb8229fda0f0901c47d21ac5ce244f403f63 | [
"Apache-2.0"
] | 16 | 2020-07-10T08:31:18.000Z | 2022-03-24T13:28:15.000Z | nnabla_nas/optimizer/__init__.py | sony/nnabla-nas | 269deb8229fda0f0901c47d21ac5ce244f403f63 | [
"Apache-2.0"
] | 1 | 2020-10-21T12:46:30.000Z | 2021-02-03T00:18:29.000Z | nnabla_nas/optimizer/__init__.py | sony/nnabla-nas | 269deb8229fda0f0901c47d21ac5ce244f403f63 | [
"Apache-2.0"
] | 3 | 2020-07-15T11:42:11.000Z | 2022-03-25T16:54:49.000Z | # Copyright (c) 2020 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 36.944444 | 74 | 0.760902 |
from .optimizer import Optimizer
__all__ = ['Optimizer']
| true | true |
1c382788882dfc7e712f0027de33754dbb491241 | 3,234 | py | Python | src/DanceCV.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 33 | 2015-01-02T08:14:39.000Z | 2021-12-08T16:13:12.000Z | src/DanceCV.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 2 | 2018-03-03T09:18:58.000Z | 2020-06-29T08:25:20.000Z | src/DanceCV.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 17 | 2015-11-22T03:42:59.000Z | 2021-11-18T13:05:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (c) 2014, Esteban Pardo Sánchez
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyri... | 34.404255 | 83 | 0.683055 |
from Resource import Resource
from Audio import Audio
from Scene import Scene
from Song import Song, Note, loadSong
from Input import Input
import pygame
from pygame.locals import *
import sys
import getopt
import Constants
class DanceCV():
def __init__(self, song, speed):
self.input = Input()
se... | true | true |
1c3828893b4eae531bd9c2811241ec3653b28a34 | 4,349 | tac | Python | mailmynet/Maildir/proxy_postfix/Twisted-11.0.0/doc/core/howto/tutorial/listings/finger/finger18.tac | SPIN-UMass/SWEET | 1b0f39222e7064f70812e3293ca023619295741d | [
"MIT"
] | 3 | 2020-04-02T06:23:44.000Z | 2020-08-13T20:32:31.000Z | mailmynet/Maildir/proxy_postfix/Twisted-11.0.0/doc/core/howto/tutorial/listings/finger/finger18.tac | SPIN-UMass/SWEET | 1b0f39222e7064f70812e3293ca023619295741d | [
"MIT"
] | null | null | null | mailmynet/Maildir/proxy_postfix/Twisted-11.0.0/doc/core/howto/tutorial/listings/finger/finger18.tac | SPIN-UMass/SWEET | 1b0f39222e7064f70812e3293ca023619295741d | [
"MIT"
] | 1 | 2020-04-02T06:26:10.000Z | 2020-04-02T06:26:10.000Z | # Do everything properly
from twisted.application import internet, service
from twisted.internet import protocol, reactor, defer
from twisted.words.protocols import irc
from twisted.protocols import basic
from twisted.web import resource, server, static, xmlrpc
import cgi
def catchError(err):
return "Internal erro... | 29.585034 | 69 | 0.627271 | from twisted.application import internet, service
from twisted.internet import protocol, reactor, defer
from twisted.words.protocols import irc
from twisted.protocols import basic
from twisted.web import resource, server, static, xmlrpc
import cgi
def catchError(err):
return "Internal error in server"
class Fing... | true | true |
1c3828ea6b5762a786575e6a8677fcca9f43fee1 | 3,220 | py | Python | app/db/__init__.py | MoeZilla/BlueMoonVampireBot | af074f846b56e7a4f262740d7b65b32ab11a4e42 | [
"MIT"
] | 1 | 2022-01-25T06:28:51.000Z | 2022-01-25T06:28:51.000Z | app/db/__init__.py | MoeZilla/BlueMoonVampireBot | af074f846b56e7a4f262740d7b65b32ab11a4e42 | [
"MIT"
] | null | null | null | app/db/__init__.py | MoeZilla/BlueMoonVampireBot | af074f846b56e7a4f262740d7b65b32ab11a4e42 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (C) 2021-2022, NkSama
Copyright (C) 2021-2022 Moezilla
Copyright (c) 2021, Sylviorus, <https://github.com/Sylviorus/BlueMoonVampireBot>
This file is part of @BlueMoonVampireBot (Antispam Telegram Bot)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software... | 33.195876 | 80 | 0.614907 |
import json
from operator import index
from re import S
from pymongo import MongoClient
import os
class DATABASE:
def __init__(self, db_url) -> None:
self.db_url = db_url
self.role_db = MongoClient(self.db_url)['Sylviorus']['CUSTOM_ROLES']
def already_exists(self, user_id):
x = self... | true | true |
1c38290c557a6708c9109fea74a5db7debcf6324 | 3,521 | py | Python | school/models.py | ntwaliandy/school-system | 93b81f62a21ae477ac524a99d2fbb6f16ef2efae | [
"MIT"
] | null | null | null | school/models.py | ntwaliandy/school-system | 93b81f62a21ae477ac524a99d2fbb6f16ef2efae | [
"MIT"
] | null | null | null | school/models.py | ntwaliandy/school-system | 93b81f62a21ae477ac524a99d2fbb6f16ef2efae | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class TeacherExtra(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
salary = models.PositiveIntegerField(null=False)
joindate=models.DateField(auto_now_add=True)
mobile = models.C... | 36.298969 | 112 | 0.703777 | from django.db import models
from django.contrib.auth.models import User
class TeacherExtra(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
salary = models.PositiveIntegerField(null=False)
joindate=models.DateField(auto_now_add=True)
mobile = models.CharField(max_length=40)
... | true | true |
1c38298251177b9e862ba52d259770df7599f35e | 11,130 | py | Python | tests/func/test_scm.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | tests/func/test_scm.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | 87 | 2021-04-27T08:17:31.000Z | 2022-03-30T12:12:40.000Z | tests/func/test_scm.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | import os
import sys
import pytest
from git import Repo
from dvc.scm import SCM, Git, NoSCM
from dvc.scm.base import SCMError
from dvc.system import System
from tests.basic_env import TestGitSubmodule
from tests.utils import get_gitignore_content
def test_init_none(tmp_dir):
assert isinstance(SCM(os.fspath(tmp_... | 29.060052 | 79 | 0.637556 | import os
import sys
import pytest
from git import Repo
from dvc.scm import SCM, Git, NoSCM
from dvc.scm.base import SCMError
from dvc.system import System
from tests.basic_env import TestGitSubmodule
from tests.utils import get_gitignore_content
def test_init_none(tmp_dir):
assert isinstance(SCM(os.fspath(tmp_... | true | true |
1c382bdec7b3a619d5432493cd7bf74eed54be9e | 1,236 | py | Python | src/ikea_api/endpoints/search.py | RCRalph/ikea-api-client | 51c71bfc423d0b995f60add11837d7860d14f754 | [
"MIT"
] | null | null | null | src/ikea_api/endpoints/search.py | RCRalph/ikea-api-client | 51c71bfc423d0b995f60add11837d7860d14f754 | [
"MIT"
] | null | null | null | src/ikea_api/endpoints/search.py | RCRalph/ikea-api-client | 51c71bfc423d0b995f60add11837d7860d14f754 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Any, Literal
from ikea_api.abc import Endpoint, SessionInfo, endpoint
from ikea_api.base_ikea_api import BaseIkeaAPI
from ikea_api.error_handlers import handle_json_decode_error
SearchType = Literal["PRODUCT", "CONTENT", "PLANNER", "REFINED_SEARCHES", "ANSWER"]
... | 34.333333 | 116 | 0.631877 | from __future__ import annotations
from typing import Any, Literal
from ikea_api.abc import Endpoint, SessionInfo, endpoint
from ikea_api.base_ikea_api import BaseIkeaAPI
from ikea_api.error_handlers import handle_json_decode_error
SearchType = Literal["PRODUCT", "CONTENT", "PLANNER", "REFINED_SEARCHES", "ANSWER"]
... | true | true |
1c382c4356470aefb4f62003845ae4e4c6777f19 | 1,608 | py | Python | CFM_main/reader.py | michaelleerilee/CommunityFirnModel | 312fc30b62b7e36a609660e5b10e3269eb090bae | [
"MIT"
] | null | null | null | CFM_main/reader.py | michaelleerilee/CommunityFirnModel | 312fc30b62b7e36a609660e5b10e3269eb090bae | [
"MIT"
] | null | null | null | CFM_main/reader.py | michaelleerilee/CommunityFirnModel | 312fc30b62b7e36a609660e5b10e3269eb090bae | [
"MIT"
] | null | null | null | #!usr/bin/env python
'''
Functions to read model inputs.
'''
import os
import numpy as np
# from string import join
from constants import *
import h5py
def read_input(filename,StartDate=None):
'''
Read in data from csv input files
:param filename: name of the file which holds the accumulation rate data
... | 26.8 | 114 | 0.659204 |
import os
import numpy as np
from constants import *
import h5py
def read_input(filename,StartDate=None):
spot = os.getcwd()
FID = os.path.join(spot, filename)
data = np.loadtxt(FID, delimiter=',') xx,yy = np.shape(data)
if xx>yy:
input_year = data[:, 0]
input_data =... | true | true |
1c382cadea0a62ded77480b47a1fb27b85d96974 | 12,384 | py | Python | third_party/html5lib/tests/test_treewalkers.py | dewitt/appengine-unshorten | 1bb9e277eb67cefbf176b104d3297da5402e67b7 | [
"Apache-2.0"
] | 1 | 2020-09-03T23:55:06.000Z | 2020-09-03T23:55:06.000Z | third_party/html5lib/tests/test_treewalkers.py | dewitt/appengine-unshorten | 1bb9e277eb67cefbf176b104d3297da5402e67b7 | [
"Apache-2.0"
] | null | null | null | third_party/html5lib/tests/test_treewalkers.py | dewitt/appengine-unshorten | 1bb9e277eb67cefbf176b104d3297da5402e67b7 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import StringIO
import unittest
import warnings
warnings.simplefilter("error")
from support import html5lib_test_files, TestData, convertExpected
from html5lib import html5parser, treewalkers, treebuilders, constants
from html5lib.filters.lint import Filter as LintFilter, LintError
def PullDOMA... | 38.222222 | 87 | 0.537791 | import os
import sys
import StringIO
import unittest
import warnings
warnings.simplefilter("error")
from support import html5lib_test_files, TestData, convertExpected
from html5lib import html5parser, treewalkers, treebuilders, constants
from html5lib.filters.lint import Filter as LintFilter, LintError
def PullDOMA... | true | true |
1c382cbe929885479c5aacb20d6f2814d53176b1 | 10,360 | py | Python | rnn-gru-random/train.py | manashpratim/Classification-of-Song-Attributes-using-Lyrics | 801b7d45bd98f3edbb4219d7e947a1bd20ec206c | [
"MIT"
] | 1 | 2020-01-17T03:05:48.000Z | 2020-01-17T03:05:48.000Z | rnn-gru-random/train.py | manashpratim/Classification-of-Song-Attributes-using-Lyrics | 801b7d45bd98f3edbb4219d7e947a1bd20ec206c | [
"MIT"
] | null | null | null | rnn-gru-random/train.py | manashpratim/Classification-of-Song-Attributes-using-Lyrics | 801b7d45bd98f3edbb4219d7e947a1bd20ec206c | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import os,sys
import datetime
import time
from rnn import RNN
import data_helpers
# Parameters
# ==================================================
did = sys.argv[1]
f1 = open("log_{}".format(did),"w")
# Data loading params
tf.flags.DEFINE_string("pos_dir", "data/rt-polarityd... | 48.867925 | 122 | 0.597587 | import tensorflow as tf
import numpy as np
import os,sys
import datetime
import time
from rnn import RNN
import data_helpers
did = sys.argv[1]
f1 = open("log_{}".format(did),"w")
tf.flags.DEFINE_string("pos_dir", "data/rt-polaritydata/rt-polarity.pos", "Path of positive data")
tf.flags.DEFINE_string("neg_dir", "data/r... | true | true |
1c382d2b8800ba69f78fa9e0859b7d4c992c4f1e | 4,842 | py | Python | earth_enterprise/src/server/wsgi/serve/constants.py | jsuberza/earthenterprise | e661a41f7cc218c60b269b0c9911df928cd9ce12 | [
"Apache-2.0"
] | 1 | 2020-06-17T12:20:52.000Z | 2020-06-17T12:20:52.000Z | earth_enterprise/src/server/wsgi/serve/constants.py | jsuberza/earthenterprise | e661a41f7cc218c60b269b0c9911df928cd9ce12 | [
"Apache-2.0"
] | null | null | null | earth_enterprise/src/server/wsgi/serve/constants.py | jsuberza/earthenterprise | e661a41f7cc218c60b269b0c9911df928cd9ce12 | [
"Apache-2.0"
] | 1 | 2020-12-16T09:26:10.000Z | 2020-12-16T09:26:10.000Z | #!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 31.855263 | 79 | 0.803594 |
MULTI_PART_PARAMETER_DELIMITER = ","
POI_SEARCH_SERVICE_NAME = "POISearch"
DEFAULT_SEARCH_SERVICE_NAME = "GeocodingFederated"
HOST_NAME = "Host"
CMD = "Cmd"
CMD_PING = "Ping"
CMD_RESET = "Reset"
CMD_QUERY = "Query"
CMD_ADD_DB = "AddDb"
CMD_DELETE_DB = "DeleteDb"
CMD_CLEANUP_DB = "CleanupDb"
CMD_PUBLISH_DB = "Publi... | true | true |
1c382f14053fc6ec2c7e73bebc1a8bdd0037777f | 333 | py | Python | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | scripts/5.2.plot_stability.py | nmningmei/agent_models | 8380f1203e6d5a18f18f9adeb6bd36b23b2ae61b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 29 08:37:19 2020
@author: nmei
"""
import os
import gc
from glob import glob
from tqdm import tqdm
import numpy as np
import pandas as pd
import seaborn as sns
working_dir = '../stability'
working_data = glob(os.path.join(working_dir,'*','stabil... | 15.136364 | 67 | 0.6997 |
import os
import gc
from glob import glob
from tqdm import tqdm
import numpy as np
import pandas as pd
import seaborn as sns
working_dir = '../stability'
working_data = glob(os.path.join(working_dir,'*','stability*.npy'))
| true | true |
1c382f9eb7b88a9524ab2bb8a7334e5fa289e7f2 | 3,001 | py | Python | vim/choices/letter.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | 3 | 2020-09-06T10:40:19.000Z | 2020-09-29T20:39:52.000Z | vim/choices/letter.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | vim/choices/letter.py | GoNZooo/dragonfly-grammars | 22d639d8f86f4f5a7c44caa73e75c4938c0ce199 | [
"MIT"
] | null | null | null | from dragonfly import (Choice)
def letter_choice(name="letter"):
return Choice(name, {
'air': 'a',
'bat': 'b',
'cap': 'c',
'drum': 'd',
'each': 'e',
'fine': 'f',
'gust': 'g',
'harp': 'h',
'sit': 'i',
'jim': 'j',
'kick': 'k',
... | 22.22963 | 49 | 0.377541 | from dragonfly import (Choice)
def letter_choice(name="letter"):
return Choice(name, {
'air': 'a',
'bat': 'b',
'cap': 'c',
'drum': 'd',
'each': 'e',
'fine': 'f',
'gust': 'g',
'harp': 'h',
'sit': 'i',
'jim': 'j',
'kick': 'k',
... | true | true |
1c38306c2d00deac55934d2428e42f226f59dead | 1,096 | py | Python | app/app/urls.py | gbr-mendes/ead-courses-api | fd0fcc8aef996c4b671f34d51a8a74aafdf78480 | [
"MIT"
] | 1 | 2022-01-31T18:12:42.000Z | 2022-01-31T18:12:42.000Z | app/app/urls.py | gbr-mendes/ead-courses-api | fd0fcc8aef996c4b671f34d51a8a74aafdf78480 | [
"MIT"
] | null | null | null | app/app/urls.py | gbr-mendes/ead-courses-api | fd0fcc8aef996c4b671f34d51a8a74aafdf78480 | [
"MIT"
] | null | null | null | """app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 36.533333 | 90 | 0.69708 | from django.contrib import admin
from django.urls import path, include
from university import views
urlpatterns = [
path('admin/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')),
path('', views.ExibitionView.as_view(), name='home_message'),# apresatation of project
path... | true | true |
1c3830931ecef6f54d56e54465037878caf81142 | 8,102 | py | Python | spatial_reasoning/models/uvfa_text.py | MarcCote/spatial-reasoning | 06c57cfafbd1c24b68d6ab634d19806964d867f3 | [
"MIT"
] | null | null | null | spatial_reasoning/models/uvfa_text.py | MarcCote/spatial-reasoning | 06c57cfafbd1c24b68d6ab634d19806964d867f3 | [
"MIT"
] | null | null | null | spatial_reasoning/models/uvfa_text.py | MarcCote/spatial-reasoning | 06c57cfafbd1c24b68d6ab634d19806964d867f3 | [
"MIT"
] | null | null | null | ## predicts entire value map
## rather than a single value
import torch
import math, torch.nn as nn, pdb
import torch.nn.functional as F
from torch.autograd import Variable
import spatial_reasoning.models as models
import spatial_reasoning.utils as utils
class UVFA_text(nn.Module):
def __init__(self, lstm, state_... | 36.169643 | 111 | 0.620464 |
import torch
import math, torch.nn as nn, pdb
import torch.nn.functional as F
from torch.autograd import Variable
import spatial_reasoning.models as models
import spatial_reasoning.utils as utils
class UVFA_text(nn.Module):
def __init__(self, lstm, state_vocab, object_vocab, args, map_dim = 10, batch_size = 32):
... | true | true |
1c383171fd75508cefec057633d20ca9a2f06f7e | 8,220 | py | Python | bzt/modules/java/tools.py | YajanaRao/taurus | c08e5b90063bf4f7904e8ec4eb5f3c50a8e89ac0 | [
"Apache-2.0"
] | null | null | null | bzt/modules/java/tools.py | YajanaRao/taurus | c08e5b90063bf4f7904e8ec4eb5f3c50a8e89ac0 | [
"Apache-2.0"
] | null | null | null | bzt/modules/java/tools.py | YajanaRao/taurus | c08e5b90063bf4f7904e8ec4eb5f3c50a8e89ac0 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | 36.533333 | 112 | 0.693309 | import re
import subprocess
from bzt import ToolError
from bzt.utils import shell_exec, sync_run, RequiredTool, parse_java_version
class JarTool(RequiredTool):
VERSION = ""
URL = "{remote_addr}{remote_path}"
REMOTE_ADDR = "http://search.maven.org/remotecontent?filepath="
REMOTE_PATH = ""
LOCAL_PA... | true | true |
1c383228303b44befe4c767af4340793fe11954c | 7,109 | py | Python | chemfiles/trajectory.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 2 | 2019-04-17T11:13:13.000Z | 2021-04-28T20:34:49.000Z | chemfiles/trajectory.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 15 | 2016-02-19T21:51:33.000Z | 2021-07-21T09:01:52.000Z | chemfiles/trajectory.py | chemfiles/Chemharp.py | 45b8a02b7a0f07d6dcafa52db39df6a39f6f496c | [
"BSD-3-Clause"
] | 3 | 2020-06-16T08:41:24.000Z | 2021-07-22T14:51:33.000Z | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64, c_char_p
import sys
from .utils import CxxPointer, _call_with_growing_buffer
from .frame import Frame, Topology
from .misc import ChemfilesError
# Python 2 compatibility
if sys.hexversion >= 0x... | 32.760369 | 87 | 0.60965 | from __future__ import absolute_import, print_function, unicode_literals
from ctypes import c_uint64, c_char_p
import sys
from .utils import CxxPointer, _call_with_growing_buffer
from .frame import Frame, Topology
from .misc import ChemfilesError
if sys.hexversion >= 0x03000000:
unicode_string = str
bytes_str... | true | true |
1c38332477ade3863d6275a24700253942626083 | 29,157 | py | Python | core/domain/collection_domain_test.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | core/domain/collection_domain_test.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | core/domain/collection_domain_test.py | alexewu/oppia | 57c3c660ab7974835ec068d7c7f5ce5b5f1f25ae | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2015 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 36.629397 | 79 | 0.673732 |
from core.domain import collection_domain
from core.domain import collection_services
from core.tests import test_utils
import feconf
import utils
SAMPLE_YAML_CONTENT = ("""category: A category
language_code: en
nodes:
- exploration_id: an_exploration_id
objective: An objective
schema_version: %d
tags: []
title: A ... | true | true |
1c3833377ac441e8cf3d5885d193dc72b8a361ad | 64 | py | Python | bokeh_metaplot/__init__.py | doomsplayer/bokeh-metaplot | e5f74017a6ed6c60b6a37a87a071ea54ab882f9c | [
"MIT"
] | null | null | null | bokeh_metaplot/__init__.py | doomsplayer/bokeh-metaplot | e5f74017a6ed6c60b6a37a87a071ea54ab882f9c | [
"MIT"
] | null | null | null | bokeh_metaplot/__init__.py | doomsplayer/bokeh-metaplot | e5f74017a6ed6c60b6a37a87a071ea54ab882f9c | [
"MIT"
] | null | null | null | from .metaplot import MetaPlot, MetaChart, MetaFigure, metaize
| 21.333333 | 62 | 0.8125 | from .metaplot import MetaPlot, MetaChart, MetaFigure, metaize
| true | true |
1c38333a94e6ed4e43e327d6343bda2f1d029216 | 10,159 | py | Python | prompt_toolkit/input/vt100.py | mark64/python-prompt-toolkit | df768003df167382f3a11a73d800a4555ca1157c | [
"BSD-3-Clause"
] | 2 | 2020-05-29T17:51:10.000Z | 2020-05-29T17:52:26.000Z | prompt_toolkit/input/vt100.py | vxgmichel/python-prompt-toolkit | a49c486fa5ae6ad5a38ff3c1050f9c9609acac1d | [
"BSD-3-Clause"
] | null | null | null | prompt_toolkit/input/vt100.py | vxgmichel/python-prompt-toolkit | a49c486fa5ae6ad5a38ff3c1050f9c9609acac1d | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import io
import os
import sys
import termios
import tty
from asyncio import AbstractEventLoop, get_event_loop
from typing import (
Callable,
ContextManager,
Dict,
Generator,
List,
Optional,
Set,
TextIO,
Tuple,
Union,
)
from prompt_toolkit.utils import is_dumb_... | 32.353503 | 87 | 0.617974 | import contextlib
import io
import os
import sys
import termios
import tty
from asyncio import AbstractEventLoop, get_event_loop
from typing import (
Callable,
ContextManager,
Dict,
Generator,
List,
Optional,
Set,
TextIO,
Tuple,
Union,
)
from prompt_toolkit.utils import is_dumb_... | true | true |
1c3833a131a1ebfe57e0a4626e989e801f84a185 | 480 | py | Python | pdf_first_page_to_jpg.py | Pakequis/Python_scripts | b0de2e2647ecaed331e7f8df2422b548df4b348c | [
"MIT"
] | null | null | null | pdf_first_page_to_jpg.py | Pakequis/Python_scripts | b0de2e2647ecaed331e7f8df2422b548df4b348c | [
"MIT"
] | null | null | null | pdf_first_page_to_jpg.py | Pakequis/Python_scripts | b0de2e2647ecaed331e7f8df2422b548df4b348c | [
"MIT"
] | null | null | null | # Library: pdf2image and poppler-0.68.0
import os
from pdf2image import convert_from_path
pdf_dir = "PATH" #Path to the pdf folder
os.chdir(pdf_dir)
print("PDF to image start...")
for pdf_file in os.listdir(pdf_dir):
if pdf_file.endswith(".pdf"):
pages = convert_from_path(pdf_file, 150,None,1,1) #seco... | 22.857143 | 95 | 0.66875 |
import os
from pdf2image import convert_from_path
pdf_dir = "PATH"
os.chdir(pdf_dir)
print("PDF to image start...")
for pdf_file in os.listdir(pdf_dir):
if pdf_file.endswith(".pdf"):
pages = convert_from_path(pdf_file, 150,None,1,1) pdf_file = pdf_file[:-4]
pages[0].save("%s.jpg" % (p... | true | true |
1c38359cb800082b537261c0842402b9fd7bf36f | 84 | py | Python | backend/fms_core/template_importer/row_handlers/container_rename/__init__.py | c3g/freezeman | bc4b6c8a2876e888ce41b7d14127cc22bc2b2143 | [
"W3C"
] | 2 | 2021-07-31T13:20:08.000Z | 2021-09-28T13:18:55.000Z | backend/fms_core/template_importer/row_handlers/container_creation/__init__.py | c3g/freezeman | bc4b6c8a2876e888ce41b7d14127cc22bc2b2143 | [
"W3C"
] | 71 | 2021-03-12T22:08:19.000Z | 2022-03-25T15:24:40.000Z | backend/fms_core/template_importer/row_handlers/container_rename/__init__.py | c3g/freezeman | bc4b6c8a2876e888ce41b7d14127cc22bc2b2143 | [
"W3C"
] | null | null | null | from .container import ContainerRowHandler
__all__ = [
"ContainerRowHandler",
] | 16.8 | 42 | 0.761905 | from .container import ContainerRowHandler
__all__ = [
"ContainerRowHandler",
] | true | true |
1c3836841e8cbea4eab578bd595d3c962670d427 | 4,334 | py | Python | senlin-7.0.0/senlin/objects/profile.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 45 | 2015-10-18T02:56:50.000Z | 2022-03-01T15:28:02.000Z | senlin-7.0.0/senlin/objects/profile.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | senlin-7.0.0/senlin/objects/profile.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 45 | 2015-10-19T02:35:57.000Z | 2021-09-28T09:01:42.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | 36.728814 | 75 | 0.643747 |
from oslo_utils import uuidutils
from senlin.common import exception
from senlin.common import utils
from senlin.db import api as db_api
from senlin.objects import base
from senlin.objects import fields
@base.SenlinObjectRegistry.register
class Profile(base.SenlinObject, base.VersionedObjectDictCompat):
fields... | true | true |
1c38375926e5e1f1169c96ab24e03ac84e1f9163 | 1,355 | py | Python | python/week9.py | Coding-Dojo-ACC/group-a-project | 5c5dbf5eb124f78a239de1f80f8b2178e6734e6a | [
"MIT"
] | null | null | null | python/week9.py | Coding-Dojo-ACC/group-a-project | 5c5dbf5eb124f78a239de1f80f8b2178e6734e6a | [
"MIT"
] | null | null | null | python/week9.py | Coding-Dojo-ACC/group-a-project | 5c5dbf5eb124f78a239de1f80f8b2178e6734e6a | [
"MIT"
] | 3 | 2021-02-13T01:20:23.000Z | 2021-02-26T22:29:13.000Z | # Count by 5's
# for x in range(5,1000,1) # start at 5 go till 1000 and count every number
# for x in range(5, 101, 5): # start at 5 go till 1000 and add 5 each iteration
# print(x)
# for y in range(5, 101, 1):
# if y % 5 == 0:
# print(y)
def flexCount(lowNum, hiNum, mult):
for i in range(lowN... | 17.828947 | 90 | 0.551292 |
# for x in range(5,1000,1) # start at 5 go till 1000 and count every number
# for x in range(5, 101, 5): # start at 5 go till 1000 and add 5 each iteration
# print(x)
# for y in range(5, 101, 1):
# if y % 5 == 0:
# print(y)
def flexCount(lowNum, hiNum, mult):
for i in range(lowNum, hiNum +1):
... | true | true |
1c3838f06848ee092c71412bf25ae399d92d7be1 | 7,375 | py | Python | napari/_vispy/vispy_image_layer.py | glyg/napari | be196dc979aed663a484f3a424dacc3227f7c958 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_image_layer.py | glyg/napari | be196dc979aed663a484f3a424dacc3227f7c958 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_image_layer.py | glyg/napari | be196dc979aed663a484f3a424dacc3227f7c958 | [
"BSD-3-Clause"
] | null | null | null | from vispy.scene.visuals import Image as ImageNode
from vispy.scene.visuals import Volume as VolumeNode
from vispy.color import Colormap
import numpy as np
from .vispy_base_layer import VispyBaseLayer
texture_dtypes = [
np.dtype(np.int8),
np.dtype(np.uint8),
np.dtype(np.int16),
np.dtype(np.uint16),
... | 33.371041 | 111 | 0.591051 | from vispy.scene.visuals import Image as ImageNode
from vispy.scene.visuals import Volume as VolumeNode
from vispy.color import Colormap
import numpy as np
from .vispy_base_layer import VispyBaseLayer
texture_dtypes = [
np.dtype(np.int8),
np.dtype(np.uint8),
np.dtype(np.int16),
np.dtype(np.uint16),
... | true | true |
1c3839b056d2f071491f44d4a6e908496eab21cc | 979 | py | Python | setup.py | spell00/pytorch-fmri | 42abd1e5a9a54cd4f4b7e0e89579301203d0aeb0 | [
"MIT"
] | null | null | null | setup.py | spell00/pytorch-fmri | 42abd1e5a9a54cd4f4b7e0e89579301203d0aeb0 | [
"MIT"
] | null | null | null | setup.py | spell00/pytorch-fmri | 42abd1e5a9a54cd4f4b7e0e89579301203d0aeb0 | [
"MIT"
] | null | null | null | import os
import sys
from distutils.sysconfig import get_python_lib
from distutils.core import setup
from setuptools import find_packages
CURRENT_PYTHON = sys.version_info[:2]
setup(name="fmri", version="0.2",
description="A package for learning to classify raw audio according to a user's self-definied "
... | 31.580645 | 101 | 0.490296 | import os
import sys
from distutils.sysconfig import get_python_lib
from distutils.core import setup
from setuptools import find_packages
CURRENT_PYTHON = sys.version_info[:2]
setup(name="fmri", version="0.2",
description="A package for learning to classify raw audio according to a user's self-definied "
... | true | true |
1c383a6063e6bece097dd6a9255159222e9b8380 | 70,322 | py | Python | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 1,118 | 2018-03-30T02:01:17.000Z | 2022-03-22T07:25:58.000Z | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 82 | 2018-04-12T12:54:05.000Z | 2022-03-31T11:14:31.000Z | tensorflow_model_analysis/writers/metrics_plots_and_validations_writer_test.py | jaymessina3/model-analysis | 8638ad375d860a97df5938850c59c72b0def995a | [
"Apache-2.0"
] | 280 | 2018-03-30T15:58:02.000Z | 2022-03-21T07:41:53.000Z | # Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 33.695256 | 98 | 0.543998 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import string
import tempfile
from absl.testing import parameterized
import apache_beam as beam
from apache_beam.testing import util
import numpy as np
import tensorflow as tf
from tensorflow_model_... | true | true |
1c383a645bd26f9fa6a5955ec222204a3829f31e | 5,276 | py | Python | tests/filters/path_filter.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | 1,253 | 2015-01-02T13:58:02.000Z | 2022-03-31T08:43:39.000Z | tests/filters/path_filter.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | 3,388 | 2015-01-02T11:17:58.000Z | 2022-03-30T10:21:45.000Z | tests/filters/path_filter.py | pyllyukko/plaso | 7533db2d1035ca71d264d6281ebd5db2d073c587 | [
"Apache-2.0"
] | 376 | 2015-01-20T07:04:54.000Z | 2022-03-04T23:53:00.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the scan tree-based path filter."""
import unittest
from plaso.filters import path_filter
from tests.filters import test_lib
class PathFilterScanTreeTest(test_lib.FilterTestCase):
"""Tests for the path filter scan tree."""
# pylint: disable=protected... | 44.711864 | 77 | 0.69674 |
import unittest
from plaso.filters import path_filter
from tests.filters import test_lib
class PathFilterScanTreeTest(test_lib.FilterTestCase):
def testInitialize(self):
scan_tree = path_filter.PathFilterScanTree([])
self.assertIsNone(scan_tree._root_node)
paths = [
'HKEY_CURRENT_USER\\S... | true | true |
1c383c031f1ec6570de8548f7cf0b056ff16dca3 | 1,000 | py | Python | face.py | yahya-idriss/Python-Personal-assistant | 97ebac124441f3fbcb6d74a4e33da14e4632afc0 | [
"MIT"
] | null | null | null | face.py | yahya-idriss/Python-Personal-assistant | 97ebac124441f3fbcb6d74a4e33da14e4632afc0 | [
"MIT"
] | null | null | null | face.py | yahya-idriss/Python-Personal-assistant | 97ebac124441f3fbcb6d74a4e33da14e4632afc0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import cv2
import numpy as np
import sqlite3
from function import function
class face_detect():
def __init__(self):
self.cam = cv2.VideoCapture(0)
self.detector=cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
server = function()
self.id = serve... | 25 | 94 | 0.583 |
import os
import cv2
import numpy as np
import sqlite3
from function import function
class face_detect():
def __init__(self):
self.cam = cv2.VideoCapture(0)
self.detector=cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
server = function()
self.id = server.get_last_id()
... | true | true |
1c383c2418e352a46d37f1383de7f35a738196ea | 190 | py | Python | grid_tuple.py | ErnestoPena/Game-Of-Life.-Python | 046bca4ae1c69e08efed4f45057b097653410ec8 | [
"MIT"
] | null | null | null | grid_tuple.py | ErnestoPena/Game-Of-Life.-Python | 046bca4ae1c69e08efed4f45057b097653410ec8 | [
"MIT"
] | null | null | null | grid_tuple.py | ErnestoPena/Game-Of-Life.-Python | 046bca4ae1c69e08efed4f45057b097653410ec8 | [
"MIT"
] | null | null | null | import random
def construct_main_tuple():
grid_list = []
for y in range(0,100):
for x in range(0,100):
grid_list.append([x*10, y*10, False])
return grid_list | 23.75 | 49 | 0.605263 | import random
def construct_main_tuple():
grid_list = []
for y in range(0,100):
for x in range(0,100):
grid_list.append([x*10, y*10, False])
return grid_list | true | true |
1c383d4343abe437b12bcd988019af09a77e5979 | 3,664 | py | Python | tests/components/garmin_connect/test_config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 4 | 2020-07-29T17:47:10.000Z | 2020-09-16T13:39:13.000Z | tests/components/garmin_connect/test_config_flow.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 6 | 2020-11-08T19:40:10.000Z | 2022-03-01T11:11:07.000Z | tests/components/garmin_connect/test_config_flow.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 5 | 2020-03-29T00:29:13.000Z | 2021-09-06T20:58:40.000Z | """Test the Garmin Connect config flow."""
from garminconnect import (
GarminConnectAuthenticationError,
GarminConnectConnectionError,
GarminConnectTooManyRequestsError,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.garmin_connect.const import DOMAIN
from homeassis... | 36.64 | 88 | 0.728985 | from garminconnect import (
GarminConnectAuthenticationError,
GarminConnectConnectionError,
GarminConnectTooManyRequestsError,
)
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.garmin_connect.const import DOMAIN
from homeassistant.const import CONF_ID, CONF_PASSWORD, C... | true | true |
1c383d5095d9c1f64070cb21511e8a323a60d196 | 1,832 | py | Python | ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r.py | tspen/MLOpsPython | dee07128e92c37ed6105938825530277672c8339 | [
"MIT"
] | null | null | null | ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r.py | tspen/MLOpsPython | dee07128e92c37ed6105938825530277672c8339 | [
"MIT"
] | null | null | null | ml_service/pipelines/diabetes_regression_build_train_pipeline_with_r.py | tspen/MLOpsPython | dee07128e92c37ed6105938825530277672c8339 | [
"MIT"
] | null | null | null | from azureml.pipeline.steps import PythonScriptStep
from azureml.pipeline.core import Pipeline
from azureml.core import Workspace
from azureml.core.runconfig import RunConfiguration, CondaDependencies
from ml_service.util.attach_compute import get_compute
from ml_service.util.env_variables import Env
def main():
... | 30.533333 | 70 | 0.718341 | from azureml.pipeline.steps import PythonScriptStep
from azureml.pipeline.core import Pipeline
from azureml.core import Workspace
from azureml.core.runconfig import RunConfiguration, CondaDependencies
from ml_service.util.attach_compute import get_compute
from ml_service.util.env_variables import Env
def main():
... | true | true |
1c383e37261953fcc99197b12f66d9f5d4fdffcd | 13,484 | py | Python | manila/tests/share/drivers/quobyte/test_quobyte.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 1 | 2015-05-28T22:28:08.000Z | 2015-05-28T22:28:08.000Z | manila/tests/share/drivers/quobyte/test_quobyte.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 5 | 2015-08-13T15:17:28.000Z | 2016-08-02T02:55:01.000Z | manila/tests/share/drivers/quobyte/test_quobyte.py | nidhimittalhada/access_group_repo | 62f3365bc5fb728fcca692a9b3977690fabcd78f | [
"Apache-2.0"
] | 2 | 2015-08-29T08:19:58.000Z | 2016-08-02T02:46:10.000Z | # Copyright (c) 2015 Quobyte, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 39.426901 | 79 | 0.610427 |
import mock
from oslo_config import cfg
import six
from manila import context
from manila import exception
from manila.share import configuration as config
from manila.share import driver
from manila.share.drivers.quobyte import jsonrpc
from manila.share.drivers.quobyte import quobyte
from manila import test
from man... | true | true |
1c383f0c22546fc778beaef16dcd29f57adc3e00 | 4,309 | py | Python | roles/api/files/scripts/export-fworch-config.py | NilsPur/firewall-orchestrator | 1e2dd61abc99b8dc72903abe9ac9c3172420b39f | [
"Apache-2.0"
] | null | null | null | roles/api/files/scripts/export-fworch-config.py | NilsPur/firewall-orchestrator | 1e2dd61abc99b8dc72903abe9ac9c3172420b39f | [
"Apache-2.0"
] | null | null | null | roles/api/files/scripts/export-fworch-config.py | NilsPur/firewall-orchestrator | 1e2dd61abc99b8dc72903abe9ac9c3172420b39f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# export-fworch-config.py: export the full config of the product itself for later import
# does not contain any firewall config data, just the device config plus fworch user config
import sys, logging
import json, requests, requests.packages, argparse
base_dir = "/usr/local/fworch"
importer_base_d... | 36.516949 | 202 | 0.668369 |
import sys, logging
import json, requests, requests.packages, argparse
base_dir = "/usr/local/fworch"
importer_base_dir = base_dir + '/importer'
sys.path.append(importer_base_dir)
import common, fwo_api
parser = argparse.ArgumentParser(
description='Export fworch configuration into encrypted json file')
parser.ad... | true | true |
1c383f218af36d693de4546a8854dc5ea2264b12 | 785 | py | Python | resource_group.py | gfortil/hpcc-internship | 8061771bcb4791fca54e6b1d74f0c019ad69bca4 | [
"MIT"
] | null | null | null | resource_group.py | gfortil/hpcc-internship | 8061771bcb4791fca54e6b1d74f0c019ad69bca4 | [
"MIT"
] | null | null | null | resource_group.py | gfortil/hpcc-internship | 8061771bcb4791fca54e6b1d74f0c019ad69bca4 | [
"MIT"
] | 1 | 2021-06-10T22:07:15.000Z | 2021-06-10T22:07:15.000Z | import subprocess
from config import region_codes, resource_prefix, spot_region_map
def create_resource_group(regions, prefix):
for location in regions:
resource_group_name = prefix + str(location)
command = 'az group create --name {} --location {}'.format(resource_group_name, location)
s... | 37.380952 | 98 | 0.719745 | import subprocess
from config import region_codes, resource_prefix, spot_region_map
def create_resource_group(regions, prefix):
for location in regions:
resource_group_name = prefix + str(location)
command = 'az group create --name {} --location {}'.format(resource_group_name, location)
s... | true | true |
1c383f8b680f153f22ac31cf1562d4db70ad8920 | 5,771 | py | Python | pychron/experiment/automated_run/factory_view.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | null | null | null | pychron/experiment/automated_run/factory_view.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | 11 | 2015-10-08T14:21:39.000Z | 2022-01-26T14:19:21.000Z | pychron/experiment/automated_run/factory_view.py | UManPychron/pychron | b84c9fd70072f9cbda30abe2c471e64fe3dd75d8 | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2013 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | 51.990991 | 117 | 0.515162 |
from traits.api import HasTraits, Instance
from traitsui.api import View, Item, VGroup, Spring, HGroup, ButtonEditor
from pychron.core.pychron_traits import BorderVGroup
from pychron.core.ui.enum_editor import myEnumEditor
from pychron.envisage.icon_button_editor import icon_button_editor
POSITION_TOOLTIP = '''Set t... | true | true |
1c384065f5f0c168b0082b1c67a44eacd1b94183 | 1,376 | py | Python | service/__init__.py | nyu-devops-wishlist/wishlist | b0a99a6f9905dc8547ccbc6375e5d6db512102cf | [
"Apache-2.0"
] | 1 | 2020-03-05T21:44:09.000Z | 2020-03-05T21:44:09.000Z | service/__init__.py | nyu-devops-wishlist/wishlist | b0a99a6f9905dc8547ccbc6375e5d6db512102cf | [
"Apache-2.0"
] | 79 | 2020-02-25T23:55:32.000Z | 2020-05-12T17:44:53.000Z | service/__init__.py | nyu-devops-wishlist/wishlist | b0a99a6f9905dc8547ccbc6375e5d6db512102cf | [
"Apache-2.0"
] | 1 | 2020-03-10T21:58:13.000Z | 2020-03-10T21:58:13.000Z | """
Package: service
Package for the application models and service routes
This module creates and configures the Flask app and sets up the logging
and SQL database
"""
import os
import sys
import logging
from flask import Flask
# Create Flask application
app = Flask(__name__)
app.config.from_object('conf... | 32 | 116 | 0.694767 | import os
import sys
import logging
from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
from service import service, models
if __name__ != '__main__':
gunicorn_logger = logging.getLogger('gunicorn.error')
app.logger.handlers = gunicorn_logger.handlers
app.logger.se... | true | true |
1c384344aae69c08b0bf6b297a873f04d8fd7c49 | 49,993 | py | Python | parser/team23/interface.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | parser/team23/interface.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | parser/team23/interface.py | itsmjoe/tytus | 3b0341cc854d67979b766c5c8b06ed172ce0c913 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk
import grammar.sql_grammar as gramatica
from graphviz import Source
from tools.console_text import *
from error.errores import *
from tools.tabla_simbolos import *
import os
class window:
def __init__(self... | 46.461896 | 218 | 0.597784 | from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from PIL import Image, ImageTk
import grammar.sql_grammar as gramatica
from graphviz import Source
from tools.console_text import *
from error.errores import *
from tools.tabla_simbolos import *
import os
class window:
def __init__(self... | true | true |
1c38434c1e88f2c41b796918c5a9fbb25223104e | 3,558 | py | Python | src/cnn_text/exp10.py | numb3r33/dl_nlp | 3b28b883de08efaa2eec4bb3d976906c94b926d6 | [
"MIT"
] | null | null | null | src/cnn_text/exp10.py | numb3r33/dl_nlp | 3b28b883de08efaa2eec4bb3d976906c94b926d6 | [
"MIT"
] | 11 | 2020-03-24T16:56:30.000Z | 2022-03-11T23:45:08.000Z | src/cnn_text/exp10.py | numb3r33/dl_nlp | 3b28b883de08efaa2eec4bb3d976906c94b926d6 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import os
import argparse
from utils import *
from train import *
from losses import *
from models import *
SAMPLE_BASEPATH = '../../data/jigsaw_toxic/processed/'
BASEPATH = '../../data/jigsaw_toxic/raw/'
SUB_PATH = '../../submissions/'
MODEL_FP = '../../mo... | 40.431818 | 172 | 0.68606 | import pandas as pd
import numpy as np
import os
import argparse
from utils import *
from train import *
from losses import *
from models import *
SAMPLE_BASEPATH = '../../data/jigsaw_toxic/processed/'
BASEPATH = '../../data/jigsaw_toxic/raw/'
SUB_PATH = '../../submissions/'
MODEL_FP = '../../mo... | true | true |
1c38437f64fca9bd28d1e4f5a7c12568c004f30a | 909 | py | Python | receiver.py | lobdellb/brycemodem | d95431e93b54b08d07ebefc7b64b8c89764a4f12 | [
"MIT"
] | null | null | null | receiver.py | lobdellb/brycemodem | d95431e93b54b08d07ebefc7b64b8c89764a4f12 | [
"MIT"
] | null | null | null | receiver.py | lobdellb/brycemodem | d95431e93b54b08d07ebefc7b64b8c89764a4f12 | [
"MIT"
] | null | null | null |
import pyaudio
import wave
import time
import sys
if len(sys.argv) < 2:
print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0])
sys.exit(-1)
wf = wave.open(sys.argv[1], 'rb')
# instantiate PyAudio (1)
p = pyaudio.PyAudio()
# define callback (2)
def callback(in_data, frame_count, time_info, st... | 19.76087 | 71 | 0.656766 |
import pyaudio
import wave
import time
import sys
if len(sys.argv) < 2:
print("Plays a wave file.\n\nUsage: %s filename.wav" % sys.argv[0])
sys.exit(-1)
wf = wave.open(sys.argv[1], 'rb')
p = pyaudio.PyAudio()
def callback(in_data, frame_count, time_info, status):
print(frame_count)
data = wf.re... | true | true |
1c384397f9a6a26b3987220dac9d9957db3815cd | 2,482 | py | Python | themes/prompt-toolkit/base16/base16-cupertino.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | themes/prompt-toolkit/base16/base16-cupertino.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | themes/prompt-toolkit/base16/base16-cupertino.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# base16-prompt-toolkit (https://github.com/memeplex/base16-prompt-toolkit)
# Base16 Prompt Toolkit template by Carlos Pita (carlosjosepita@gmail.com
# Cupertino scheme by Defman21
try:
# older than v2
from prompt_toolkit.output.vt100 import _256_colors
except ModuleNotFoundError:
# vers... | 29.903614 | 109 | 0.672039 |
try:
from prompt_toolkit.output.vt100 import _256_colors
except ModuleNotFoundError:
from prompt_toolkit.formatted_text.ansi import _256_colors
from pygments.style import Style
from pygments.token import (Keyword, Name, Comment, String, Error, Text,
Number, Operator, Literal, Token... | true | true |
1c3844f5ad8864ed597c03a7ca8fc9a33d3aea8e | 3,684 | py | Python | examples/resnet/train_fleet_static_amp.py | sandyhouse/FleetX | b3d089cdb0f388c12ad95494ee98053d5bfa450b | [
"Apache-2.0"
] | 170 | 2020-08-12T12:07:01.000Z | 2022-03-07T02:38:26.000Z | examples/resnet/train_fleet_static_amp.py | sandyhouse/FleetX | b3d089cdb0f388c12ad95494ee98053d5bfa450b | [
"Apache-2.0"
] | 195 | 2020-08-13T03:22:15.000Z | 2022-03-30T07:40:25.000Z | examples/resnet/train_fleet_static_amp.py | sandyhouse/FleetX | b3d089cdb0f388c12ad95494ee98053d5bfa450b | [
"Apache-2.0"
] | 67 | 2020-08-14T02:07:46.000Z | 2022-03-28T10:05:33.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 33.798165 | 158 | 0.678882 |
import numpy as np
import argparse
import ast
import paddle
from paddle.distributed import fleet
import resnet_static as resnet
import os
base_lr = 0.1
momentum_rate = 0.9
l2_decay = 1e-4
epoch = 10
batch_size = 32
class_dim = 102
def optimizer_setting(parameter_list=None):
optimizer = paddle.optimizer.Momentum... | true | true |
1c38451fb424e2b6a391207b83c511a087bace8a | 6,177 | py | Python | cli/scaleout/details.py | ScilifelabDataCentre/stackn | 00a65a16ff271f04548b3ff475c72dacbfd916df | [
"Apache-2.0"
] | null | null | null | cli/scaleout/details.py | ScilifelabDataCentre/stackn | 00a65a16ff271f04548b3ff475c72dacbfd916df | [
"Apache-2.0"
] | null | null | null | cli/scaleout/details.py | ScilifelabDataCentre/stackn | 00a65a16ff271f04548b3ff475c72dacbfd916df | [
"Apache-2.0"
] | null | null | null | import platform
import psutil
import logging
import json
import os
import sys
from scaleout.cli.helpers import prompt
def get_system_details(info):
try:
info['Platform'] = platform.system()
#info['Platform version'] = platform.version()
info['Architecture'] = platform.machine()
info... | 51.049587 | 151 | 0.646592 | import platform
import psutil
import logging
import json
import os
import sys
from scaleout.cli.helpers import prompt
def get_system_details(info):
try:
info['Platform'] = platform.system()
info['Architecture'] = platform.machine()
info['Processor'] = platform.processor()
in... | true | true |
1c3845d71bd0808be9a45e1440e146be6fafa885 | 11,636 | py | Python | pychron/experiment/experimentor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/experiment/experimentor.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/experiment/experimentor.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2013 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | 34.942943 | 88 | 0.544173 |
from __future__ import absolute_import
from traits.api import Instance, List, on_trait_change, Bool, Event
from pychron.dvc.dvc_irradiationable import DVCIrradiationable
from pychron.experiment.experiment_executor import ExperimentExecutor
from pychron.experiment.factory import ExperimentFactory
from pychron.experim... | true | true |
1c38463f66647da1607e6d5fc5115661bd36b39a | 5,398 | py | Python | backend/api/viewsets/model_year_report_consumer_sales.py | NavpreetGrewal/zeva | a2fc9241d471bb6a2099bcf48b9589ac9391cc64 | [
"Apache-2.0"
] | null | null | null | backend/api/viewsets/model_year_report_consumer_sales.py | NavpreetGrewal/zeva | a2fc9241d471bb6a2099bcf48b9589ac9391cc64 | [
"Apache-2.0"
] | null | null | null | backend/api/viewsets/model_year_report_consumer_sales.py | NavpreetGrewal/zeva | a2fc9241d471bb6a2099bcf48b9589ac9391cc64 | [
"Apache-2.0"
] | null | null | null | from rest_framework import mixins, viewsets
from rest_framework.response import Response
from django.db.models import Q
from django.shortcuts import get_object_or_404
from api.models.model_year_report_vehicle import ModelYearReportVehicle
from api.models.model_year_report import ModelYearReport
from api.models.model_y... | 38.014085 | 85 | 0.686365 | from rest_framework import mixins, viewsets
from rest_framework.response import Response
from django.db.models import Q
from django.shortcuts import get_object_or_404
from api.models.model_year_report_vehicle import ModelYearReportVehicle
from api.models.model_year_report import ModelYearReport
from api.models.model_y... | true | true |
1c38486b5a0bdf40a741bd9dbc89b9eb9f489f78 | 1,828 | py | Python | modules/exploits/example.py | BA7JCM/metasploit-framework | a977d485084aefda76aeac2b15a8f5a4607938fc | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2022-02-19T07:46:56.000Z | 2022-02-22T02:42:09.000Z | modules/exploits/example.py | BA7JCM/metasploit-framework | a977d485084aefda76aeac2b15a8f5a4607938fc | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 5 | 2020-10-08T15:04:39.000Z | 2020-10-08T15:04:46.000Z | modules/exploits/example.py | BA7JCM/metasploit-framework | a977d485084aefda76aeac2b15a8f5a4607938fc | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2022-03-01T05:18:40.000Z | 2022-03-01T05:18:40.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# standard modules
import logging
# extra modules
dependencies_missing = False
try:
import requests
except ImportError:
dependencies_missing = True
from metasploit import module
metadata = {
'name': 'Python Module Example',
'description': '''
P... | 28.123077 | 120 | 0.599562 |
import logging
dependencies_missing = False
try:
import requests
except ImportError:
dependencies_missing = True
from metasploit import module
metadata = {
'name': 'Python Module Example',
'description': '''
Python communication with msfconsole.
''',
'authors': [
'Jacob Robl... | true | true |
1c384892c1b89f4a0ea6806632905115f06fdd7f | 1,586 | py | Python | var/spack/repos/builtin/packages/sqlcipher/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-02-08T15:05:27.000Z | 2021-02-08T15:05:27.000Z | var/spack/repos/builtin/packages/sqlcipher/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/sqlcipher/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2022-01-18T23:39:24.000Z | 2022-01-18T23:39:24.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Sqlcipher(AutotoolsPackage):
"""SQLCipher is an SQLite extension that provides 256 bit AES encryption
of d... | 46.647059 | 95 | 0.748424 | class Sqlcipher(AutotoolsPackage):
homepage = "https://www.zetetic.net/sqlcipher/"
url = "https://github.com/sqlcipher/sqlcipher/archive/v4.4.1.tar.gz"
git = "https://github.com/sqlcipher/sqlcipher.git"
maintainers = ['rmsds']
version('4.4.1', sha256='a36ed7c879a5e9af1054942201c75fc56f1... | true | true |
1c3849e06afbbb9b21ae5df801c2962db406e6ba | 91,397 | py | Python | tests/test_bert_ner.py | bond005/elmo_ner | c6135cfca5d7bf817a22c8c8631e7f81f6f05f94 | [
"Apache-2.0"
] | 80 | 2019-03-21T13:04:32.000Z | 2021-09-27T16:53:34.000Z | tests/test_bert_ner.py | bond005/elmo_ner | c6135cfca5d7bf817a22c8c8631e7f81f6f05f94 | [
"Apache-2.0"
] | 7 | 2019-06-06T13:49:54.000Z | 2022-02-10T01:05:18.000Z | tests/test_bert_ner.py | bond005/elmo_ner | c6135cfca5d7bf817a22c8c8631e7f81f6f05f94 | [
"Apache-2.0"
] | 16 | 2019-03-20T06:54:40.000Z | 2021-09-23T17:40:24.000Z | import copy
import gc
import os
import pickle
import re
import sys
import tempfile
import unittest
import numpy as np
from sklearn.exceptions import NotFittedError
from spacy_udpipe.language import UDPipeLanguage
try:
from deep_ner.bert_ner import BERT_NER
from deep_ner.utils import load_dataset_from_json, se... | 56.980673 | 120 | 0.633642 | import copy
import gc
import os
import pickle
import re
import sys
import tempfile
import unittest
import numpy as np
from sklearn.exceptions import NotFittedError
from spacy_udpipe.language import UDPipeLanguage
try:
from deep_ner.bert_ner import BERT_NER
from deep_ner.utils import load_dataset_from_json, se... | true | true |
1c384a7676714a112d2709b7de2e06ce6bb4ddd8 | 856 | py | Python | tests/test_packages/test_connections/test_tcp/__init__.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | 126 | 2019-09-07T09:32:44.000Z | 2022-03-29T14:28:41.000Z | tests/test_packages/test_connections/test_tcp/__init__.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | 1,814 | 2019-08-24T10:08:07.000Z | 2022-03-31T14:28:36.000Z | tests/test_packages/test_connections/test_tcp/__init__.py | ejfitzgerald/agents-aea | 6411fcba8af2cdf55a3005939ae8129df92e8c3e | [
"Apache-2.0"
] | 46 | 2019-09-03T22:13:58.000Z | 2022-03-22T01:25:16.000Z | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 40.761905 | 80 | 0.58528 | true | true | |
1c384c91f36d0a8c490fb7657c500258ebef08fc | 2,882 | py | Python | utils/common.py | projekgallus/gallus-gui | c7effdcbc68d64d60a96b68a1064d0f590b449b8 | [
"BSD-3-Clause"
] | null | null | null | utils/common.py | projekgallus/gallus-gui | c7effdcbc68d64d60a96b68a1064d0f590b449b8 | [
"BSD-3-Clause"
] | null | null | null | utils/common.py | projekgallus/gallus-gui | c7effdcbc68d64d60a96b68a1064d0f590b449b8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
## Copyright (c) 2018, Projek Gallus
## Copyright (c) 2017, The Sumokoin Project (www.sumokoin.org)
'''
Misc utility classes/functions for application
'''
import os, sys, string
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
... | 27.711538 | 88 | 0.62526 |
import os, sys, string
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class DummyStream:
def __init__(self): pass
def write(self,data): pass
def read(self,data): pass
def flush(self): pass
def close(self): pass
def getAppPath():
if ... | true | true |
1c384cb0654489f18fed0bfc27fa098d462fab70 | 2,131 | py | Python | core/tests.py | Wanderer2436/django_pharmacy | 2e12c41e30f2f2e2c0f3abdaded98a917420f5b8 | [
"MIT"
] | null | null | null | core/tests.py | Wanderer2436/django_pharmacy | 2e12c41e30f2f2e2c0f3abdaded98a917420f5b8 | [
"MIT"
] | 2 | 2022-03-31T14:34:44.000Z | 2022-03-31T14:35:17.000Z | core/tests.py | Wanderer2436/django_pharmacy | 2e12c41e30f2f2e2c0f3abdaded98a917420f5b8 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client, RequestFactory
from django.urls import reverse
from core import models
class ProductSearchTestCase(TestCase):
def setUp(self):
self.client = Client()
category1 = models.Category.objects.create(name='TestCat1')
category2 = models.Category.objects.cr... | 38.053571 | 97 | 0.650399 | from django.test import TestCase, Client, RequestFactory
from django.urls import reverse
from core import models
class ProductSearchTestCase(TestCase):
def setUp(self):
self.client = Client()
category1 = models.Category.objects.create(name='TestCat1')
category2 = models.Category.objects.cr... | true | true |
1c384ccc0e50dbc39e26da9575b6526332b32a5b | 1,454 | py | Python | jdcloud_sdk/services/antipro/apis/DescribeAttackSourceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/antipro/apis/DescribeAttackSourceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/antipro/apis/DescribeAttackSourceRequest.py | jdcloud-apigateway/jdcloud-sdk-python | 0886769bcf1fb92128a065ff0f4695be099571cc | [
"Apache-2.0"
] | null | null | null | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 33.045455 | 188 | 0.722146 |
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
class DescribeAttackSourceRequest(JDCloudRequest):
def __init__(self, parameters, header=None, version="v1"):
super(DescribeAttackSourceRequest, self).__init__(
'/attacklog/{attackLogId}:describeAttackSource', 'GET', header, version... | true | true |
1c384d63920592db9836d8b889c140103e7fa797 | 1,867 | py | Python | pdf_render/helpers/dados_testes.py | mauriciolongato/costurApp | 7a700ef43e94023ee94c962873f9e2324e0f7530 | [
"MIT"
] | 1 | 2019-05-12T19:16:07.000Z | 2019-05-12T19:16:07.000Z | pdf_render/helpers/dados_testes.py | mauriciolongato/costurApp | 7a700ef43e94023ee94c962873f9e2324e0f7530 | [
"MIT"
] | null | null | null | pdf_render/helpers/dados_testes.py | mauriciolongato/costurApp | 7a700ef43e94023ee94c962873f9e2324e0f7530 | [
"MIT"
] | null | null | null | from helpers import jobs, functions
def informacao_caixa():
data = {'header': {'nome_cliente': 'Polo',
'nome_caixa': 1,
'pedido_op': 'REF: COD10000001',
'referencia_id': 1,
'nome_referencia': 'Camisa Polo com Bolso',
... | 47.871795 | 112 | 0.447242 | from helpers import jobs, functions
def informacao_caixa():
data = {'header': {'nome_cliente': 'Polo',
'nome_caixa': 1,
'pedido_op': 'REF: COD10000001',
'referencia_id': 1,
'nome_referencia': 'Camisa Polo com Bolso',
... | true | true |
1c384d76c4cde6b1c2953f675082b314778a5507 | 966 | py | Python | pdb2pqr/tests/propka_test.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr/tests/propka_test.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr/tests/propka_test.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | """Tests for PROPKA functionality."""
import logging
from pathlib import Path
import pytest
import common
_LOGGER = logging.getLogger(__name__)
@pytest.mark.parametrize("input_pdb", ["1K1I", "1AFS", "1FAS", "5DV8", "5D8V"], ids=str)
def test_propka_apo(input_pdb, tmp_path):
"""PROPKA non-regression tests on pro... | 35.777778 | 88 | 0.693582 | import logging
from pathlib import Path
import pytest
import common
_LOGGER = logging.getLogger(__name__)
@pytest.mark.parametrize("input_pdb", ["1K1I", "1AFS", "1FAS", "5DV8", "5D8V"], ids=str)
def test_propka_apo(input_pdb, tmp_path):
args = "--log-level=INFO --ff=AMBER --drop-water --titration-state-method=p... | true | true |
1c384db9b4b4396fd411433687e067b395fac623 | 1,681 | py | Python | pakaman/config/targets.py | mikonse/pakaman | 4b6ac2ec550bfd642d34dce1fc406f2bd230e8de | [
"MIT"
] | 1 | 2020-10-18T17:57:30.000Z | 2020-10-18T17:57:30.000Z | pakaman/config/targets.py | mikonse/pakaman | 4b6ac2ec550bfd642d34dce1fc406f2bd230e8de | [
"MIT"
] | null | null | null | pakaman/config/targets.py | mikonse/pakaman | 4b6ac2ec550bfd642d34dce1fc406f2bd230e8de | [
"MIT"
] | null | null | null | from abc import ABCMeta
from typing import List, Dict
import schema
TARGETS = {}
class TargetMeta(ABCMeta):
def __init__(cls, name, bases, classdict):
super().__init__(name, bases, classdict)
TARGETS[cls.name] = cls
class Target(metaclass=TargetMeta):
name = "unknown"
schema = schema.S... | 30.017857 | 107 | 0.66627 | from abc import ABCMeta
from typing import List, Dict
import schema
TARGETS = {}
class TargetMeta(ABCMeta):
def __init__(cls, name, bases, classdict):
super().__init__(name, bases, classdict)
TARGETS[cls.name] = cls
class Target(metaclass=TargetMeta):
name = "unknown"
schema = schema.S... | true | true |
1c384df1fb49a37e50cba49829227f17caf3f362 | 1,404 | py | Python | AutoTriageBot/DataTypes.py | jaydave/AutoTriageBot | d87898ec11d6057797697ffa867ccb52770e65ec | [
"BSD-3-Clause"
] | 58 | 2017-09-20T16:50:25.000Z | 2021-05-15T10:22:53.000Z | AutoTriageBot/DataTypes.py | jaydave/AutoTriageBot | d87898ec11d6057797697ffa867ccb52770e65ec | [
"BSD-3-Clause"
] | 2 | 2017-09-21T17:04:10.000Z | 2017-09-25T23:29:20.000Z | AutoTriageBot/DataTypes.py | jaydave/AutoTriageBot | d87898ec11d6057797697ffa867ccb52770e65ec | [
"BSD-3-Clause"
] | 16 | 2017-09-21T00:48:37.000Z | 2021-01-02T20:22:39.000Z | """
Copyright (c) 2017, salesforce.com, inc.
All rights reserved.
Licensed under the BSD 3-Clause license.
For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from typing import NamedTuple, Mapping, Any
from datetime import datetime
# Represents the result... | 42.545455 | 109 | 0.487179 |
from typing import NamedTuple, Mapping, Any
from datetime import datetime
VulnTestInfo = NamedTuple("VulnTestInfo", [('reproduced', bool),
('info', Mapping[str, Any]),
('message', str),
('t... | true | true |
1c384df681c217a87980cd5a3d393f24b508e6e5 | 884 | py | Python | annotate_updated.py | VictoriaSugrue/sheepclock | b0eaec0b96afcc35f0d60982eb3d1215ea329d64 | [
"MIT"
] | null | null | null | annotate_updated.py | VictoriaSugrue/sheepclock | b0eaec0b96afcc35f0d60982eb3d1215ea329d64 | [
"MIT"
] | null | null | null | annotate_updated.py | VictoriaSugrue/sheepclock | b0eaec0b96afcc35f0d60982eb3d1215ea329d64 | [
"MIT"
] | null | null | null | import os
import glob
import numpy as np
import pandas as pd
filenames = [os.path.basename(x) for x in glob.glob("analysis_raw_results/*.bed")]
metadata = pd.read_table('human_factor_full_QC.txt')
for file in filenames:
temp_name = os.path.splitext(file)[0]
df_temp = pd.read_csv("analysis_raw_results/"+str(f... | 49.111111 | 190 | 0.717195 | import os
import glob
import numpy as np
import pandas as pd
filenames = [os.path.basename(x) for x in glob.glob("analysis_raw_results/*.bed")]
metadata = pd.read_table('human_factor_full_QC.txt')
for file in filenames:
temp_name = os.path.splitext(file)[0]
df_temp = pd.read_csv("analysis_raw_results/"+str(f... | true | true |
1c384e0d64e076b98463cdbac0355c84829ca88c | 1,706 | py | Python | pastey/config.py | WolfwithSword/pastey | 89b8c7a4da8a51a25270a2c9f3e6d7526c8211ad | [
"BSD-3-Clause"
] | 65 | 2021-04-13T19:10:03.000Z | 2022-02-03T01:36:04.000Z | pastey/config.py | WolfwithSword/pastey | 89b8c7a4da8a51a25270a2c9f3e6d7526c8211ad | [
"BSD-3-Clause"
] | 15 | 2021-04-14T11:57:43.000Z | 2022-03-22T02:47:15.000Z | pastey/config.py | WolfwithSword/pastey | 89b8c7a4da8a51a25270a2c9f3e6d7526c8211ad | [
"BSD-3-Clause"
] | 8 | 2021-04-15T19:18:00.000Z | 2022-02-03T03:02:27.000Z | # Data directory
data_directory = "./data"
# Listen address
listen_address = "0.0.0.0"
# Listen port
listen_port = 5000
# Use whitelisting
# Whitelisted IPs can view recent pastes on the home page, as well as delete pastes
# For limiting pasting to whitelisted users, enable the "restrict_pasting" option below
use_wh... | 27.516129 | 87 | 0.759086 | data_directory = "./data"
listen_address = "0.0.0.0"
listen_port = 5000
use_whitelist = True
whitelist_cidr = ['127.0.0.1/32', '10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16']
blacklist_cidr = []
restrict_pasting = False
rate_limit = "5/hour"
guess_threshold = 0.20
recent_pastes = 10
behind_proxy = False
def... | true | true |
1c384e41969475a7829dcd8b5e539e84df26a381 | 1,102 | py | Python | 25aapairs.py | 5ophia5/Homework | 7b756e5dd36bf5425a5ba67b7263a45ec2648510 | [
"MIT"
] | null | null | null | 25aapairs.py | 5ophia5/Homework | 7b756e5dd36bf5425a5ba67b7263a45ec2648510 | [
"MIT"
] | null | null | null | 25aapairs.py | 5ophia5/Homework | 7b756e5dd36bf5425a5ba67b7263a45ec2648510 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Print out all the unique pairwise amino acid combinations
# AC is the same as CA
# Skip AA, CC etc.
# Also print out how many combinations there are
aa = 'ACDEFGHIKLMNPQRSTVWY'
combo = 0
for aa1 in aa:
for aa2 in aa:
if aa2 > aa1:
print (aa1, aa2)
combo +=1
print(combo)
"""
python3... | 5.222749 | 59 | 0.557169 |
aa = 'ACDEFGHIKLMNPQRSTVWY'
combo = 0
for aa1 in aa:
for aa2 in aa:
if aa2 > aa1:
print (aa1, aa2)
combo +=1
print(combo)
| true | true |
1c384e66487612e80be41bfcb84c82317974ff4d | 3,353 | py | Python | db/migrations/replaceableObjects.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 27 | 2017-11-27T05:01:05.000Z | 2020-11-14T19:52:26.000Z | db/migrations/replaceableObjects.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 259 | 2017-11-23T00:43:26.000Z | 2020-11-03T01:07:30.000Z | db/migrations/replaceableObjects.py | DeschutesBrewery/brewerypi | 5459dfc6b1ed415920c13a8a7c9a2d3d3c82099f | [
"MIT"
] | 8 | 2018-10-29T04:39:29.000Z | 2020-10-01T22:18:12.000Z | from alembic.operations import Operations, MigrateOperation
# Concepts from: http://alembic.zzzcomputing.com/en/latest/cookbook.html#replaceable-objects.
class ReplaceableObject(object):
def __init__(self, name, parameters, returns, sqlText):
self.name = name
self.parameters = parameters
s... | 39.447059 | 142 | 0.742917 | from alembic.operations import Operations, MigrateOperation
class ReplaceableObject(object):
def __init__(self, name, parameters, returns, sqlText):
self.name = name
self.parameters = parameters
self.returns = returns
self.sqlText = sqlText
class ReversibleOperation(MigrateOperati... | true | true |
1c384ed35a686e610c02507262b0e05c5705abb5 | 599 | py | Python | Curso_de_Python/Mundo_02/Aula_14/Exercicios/ex058.py | tarcisioribeiro/Python | 69b8fee218a6c9b93ae7a6ea36eb903d5ac36955 | [
"MIT"
] | null | null | null | Curso_de_Python/Mundo_02/Aula_14/Exercicios/ex058.py | tarcisioribeiro/Python | 69b8fee218a6c9b93ae7a6ea36eb903d5ac36955 | [
"MIT"
] | null | null | null | Curso_de_Python/Mundo_02/Aula_14/Exercicios/ex058.py | tarcisioribeiro/Python | 69b8fee218a6c9b93ae7a6ea36eb903d5ac36955 | [
"MIT"
] | null | null | null | from random import randint
print()
print('Tente adivinhar o número que estou pensando!')
print()
npc = randint(0, 10)
nuser = -1
palpite = 0
while (npc != nuser):
nuser = int(input('Qual o número que eu pensei? '))
print()
if(nuser == npc):
print('Parabéns! Você acertou!')
print()
elif(n... | 24.958333 | 79 | 0.597663 | from random import randint
print()
print('Tente adivinhar o número que estou pensando!')
print()
npc = randint(0, 10)
nuser = -1
palpite = 0
while (npc != nuser):
nuser = int(input('Qual o número que eu pensei? '))
print()
if(nuser == npc):
print('Parabéns! Você acertou!')
print()
elif(n... | true | true |
1c384f35d72b0cdb3ecdc5e040b85c709490a00d | 3,271 | py | Python | python/pyarrow/tests/test_misc.py | tanyaschlusser/arrow | 77c6cd3237a2b305cf9c086cbf8d0a49be016701 | [
"Apache-2.0",
"CC0-1.0"
] | 1 | 2021-01-28T17:30:06.000Z | 2021-01-28T17:30:06.000Z | python/pyarrow/tests/test_misc.py | ivanyu/arrow | 5d1934fc3f5c65f70a3966b71c68941b2fd8d362 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | python/pyarrow/tests/test_misc.py | ivanyu/arrow | 5d1934fc3f5c65f70a3966b71c68941b2fd8d362 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 25.161538 | 72 | 0.690614 |
import os
import pytest
import pyarrow as pa
def test_get_include():
include_dir = pa.get_include()
assert os.path.exists(os.path.join(include_dir, 'arrow', 'api.h'))
@pytest.mark.skipif('sys.platform != "win32"')
def test_get_library_dirs_win32():
library_dirs = pa.get_library_dirs()
library_lib... | true | true |
1c3851b3d43779cdb1f4c93db026666f01001b41 | 111 | py | Python | tiingo_prices/__init__.py | robren/tiingo_prices | 3e7f45728b0c5a4a4e60f552b2fda97aa8340a20 | [
"MIT"
] | null | null | null | tiingo_prices/__init__.py | robren/tiingo_prices | 3e7f45728b0c5a4a4e60f552b2fda97aa8340a20 | [
"MIT"
] | 1 | 2020-08-11T18:16:20.000Z | 2020-08-11T18:16:20.000Z | tiingo_prices/__init__.py | robren/tiingo_prices | 3e7f45728b0c5a4a4e60f552b2fda97aa8340a20 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = """Robert Rennison"""
__email__ = 'rob@robren.net'
__version__ = '0.3.1'
| 18.5 | 34 | 0.621622 |
__author__ = """Robert Rennison"""
__email__ = 'rob@robren.net'
__version__ = '0.3.1'
| true | true |
1c38532383da6d8d572acc687d189e7ed6fd9a0d | 3,795 | py | Python | snake/base/map.py | AuthurExcalbern/AI-Snake | 5dee76fcecd40add58a432ca8b88880b00ac45b9 | [
"MIT"
] | null | null | null | snake/base/map.py | AuthurExcalbern/AI-Snake | 5dee76fcecd40add58a432ca8b88880b00ac45b9 | [
"MIT"
] | 1 | 2018-03-24T08:50:32.000Z | 2018-03-28T11:11:50.000Z | snake/base/map.py | AuthurExcalbern/AI-Snake | 5dee76fcecd40add58a432ca8b88880b00ac45b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=C0103,C0111,W0201,W0212
"""Definition of class Map."""
import random
from snake.base.point import Point, PointType
from snake.base.pos import Pos
class Map:
"""2D game map."""
def __init__(self, num_rows, num_cols):
"""Initialize a M... | 30.853659 | 85 | 0.560474 |
import random
from snake.base.point import Point, PointType
from snake.base.pos import Pos
class Map:
def __init__(self, num_rows, num_cols):
if not isinstance(num_rows, int) or not isinstance(num_cols, int):
raise TypeError("\'num_rows\' and \'num_cols\' must be integers")
if num_... | true | true |
1c385327f6e8f54f165abb2360d61facae4ffb2f | 2,063 | py | Python | tasks/UDEMY/100_days/L003/day-3-1.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | 2 | 2022-01-19T18:01:35.000Z | 2022-02-06T06:54:38.000Z | tasks/UDEMY/100_days/L003/day-3-1.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | null | null | null | tasks/UDEMY/100_days/L003/day-3-1.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | null | null | null | # 🚨 Don't change the code below 👇
number = int(input("Which number do you want to check? "))
# 🚨 Don't change the code above 👆
print("This is an even number." if number % 2 == 0
else "This is an odd number.")
#First *fork* your copy. Then copy-paste your code below this line 👇
#Finally click "Run" to execute... | 21.05102 | 122 | 0.663112 | number = int(input("Which number do you want to check? "))
# 🚨 Don't change the code above 👆
print("This is an even number." if number % 2 == 0
else "This is an odd number.")
with open('testing_copy.py', 'w') as file:
file.write('def test_func():\n')
with open('day-... | true | true |
1c3854aecee3c4aeeb666f82155b1d9948d1b537 | 13,148 | py | Python | maskrcnn_benchmark-dota/modeling/rpn/rfcos/smallerRF_wo_clsloss.py | RSIA-LIESMARS-WHU/AxisLearning | 5a108860c959a200811f9643d567ca7883c74875 | [
"BSD-2-Clause"
] | 3 | 2021-01-26T07:03:26.000Z | 2021-02-03T12:14:05.000Z | maskrcnn_benchmark/modeling/rpn/rfcos/smallerRF_wo_clsloss.py | RSIA-LIESMARS-WHU/AxisLearning | 5a108860c959a200811f9643d567ca7883c74875 | [
"BSD-2-Clause"
] | null | null | null | maskrcnn_benchmark/modeling/rpn/rfcos/smallerRF_wo_clsloss.py | RSIA-LIESMARS-WHU/AxisLearning | 5a108860c959a200811f9643d567ca7883c74875 | [
"BSD-2-Clause"
] | null | null | null | """
This file contains specific functions for computing losses of FCOS
file
"""
import torch
from torch.nn import functional as F
from torch import nn
from ..utils import concat_box_prediction_layers
from maskrcnn_benchmark.layers import IOULoss
from maskrcnn_benchmark.layers import SigmoidFocalLoss, smooth_l1_loss
f... | 40.580247 | 189 | 0.599255 |
import torch
from torch.nn import functional as F
from torch import nn
from ..utils import concat_box_prediction_layers
from maskrcnn_benchmark.layers import IOULoss
from maskrcnn_benchmark.layers import SigmoidFocalLoss, smooth_l1_loss
from maskrcnn_benchmark.modeling.matcher import Matcher
from maskrcnn_benchmark.m... | true | true |
1c385522dc3ad879da84161cb05818f4cd356848 | 8,193 | py | Python | powerline_shell/colortrans.py | vivekkrish/powerline-shell | ad27ed4ccc28f314d7985776b8e8663a33a67102 | [
"MIT"
] | 2,656 | 2017-11-28T05:11:53.000Z | 2022-03-31T14:10:18.000Z | powerline_shell/colortrans.py | vivekkrish/powerline-shell | ad27ed4ccc28f314d7985776b8e8663a33a67102 | [
"MIT"
] | 193 | 2017-11-28T23:20:17.000Z | 2022-03-25T12:57:55.000Z | powerline_shell/colortrans.py | vivekkrish/powerline-shell | ad27ed4ccc28f314d7985776b8e8663a33a67102 | [
"MIT"
] | 387 | 2017-11-29T22:33:39.000Z | 2022-03-31T18:24:35.000Z | #! /usr/bin/env python
"""
Code is modified (fairly heavily) by hryanjones@gmail.com from
https://gist.github.com/MicahElliott/719710
Convert values between RGB tuples and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output sch... | 25.683386 | 84 | 0.45368 |
__author__ = 'Micah Elliott http://MicahElliott.com'
__version__ = '0.1'
__copyright__ = 'Copyright (C) 2011 Micah Elliott. All rights reserved.'
__license__ = 'WTFPL http://sam.zoy.org/wtfpl/'
def hexstr2num(hexstr):
return int(hexstr, 16)
def rgbstring2tuple(s):
return tuple([hexstr2num(h) for h... | true | true |
1c38553cfee6e8a970919d085bb6fbe062063cc1 | 773 | py | Python | src/qgis_ros/core/translators/json_transport.py | acfrmarine/qgis_ros | 01dd107f963b87df063bf2f11b0a484f4323cae9 | [
"MIT"
] | 31 | 2018-09-11T17:50:17.000Z | 2021-09-13T11:48:47.000Z | src/qgis_ros/core/translators/json_transport.py | acfrmarine/qgis_ros | 01dd107f963b87df063bf2f11b0a484f4323cae9 | [
"MIT"
] | 9 | 2018-09-11T00:45:23.000Z | 2022-01-07T13:19:20.000Z | src/qgis_ros/core/translators/json_transport.py | acfrmarine/qgis_ros | 01dd107f963b87df063bf2f11b0a484f4323cae9 | [
"MIT"
] | 9 | 2018-10-12T12:31:38.000Z | 2021-06-05T02:52:44.000Z | import json_transport
from .translator import Translator, VectorTranslatorMixin
class JSONTransportTranslator(Translator, VectorTranslatorMixin):
messageType = json_transport.PackedJson
# geomType = Translator.GeomTypes.Unknown # Need to detect this from the first message.
geomType = Translator.GeomTyp... | 30.92 | 92 | 0.683053 | import json_transport
from .translator import Translator, VectorTranslatorMixin
class JSONTransportTranslator(Translator, VectorTranslatorMixin):
messageType = json_transport.PackedJson
geomType = Translator.GeomTypes.Polygon
@staticmethod
def translate(msg):
msg = msg.data
... | true | true |
1c3855af57ee7989c4d5d05a2f3435cc8c8f1ddf | 16,700 | py | Python | unicorn_binance_websocket_api/restclient.py | HrTran/unicorn-binance-websocket-api | 64da01868a8c251a486993b868f0de5083922d64 | [
"MIT"
] | null | null | null | unicorn_binance_websocket_api/restclient.py | HrTran/unicorn-binance-websocket-api | 64da01868a8c251a486993b868f0de5083922d64 | [
"MIT"
] | null | null | null | unicorn_binance_websocket_api/restclient.py | HrTran/unicorn-binance-websocket-api | 64da01868a8c251a486993b868f0de5083922d64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: unicorn_binance_websocket_api/restclient.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api
# Documentation: https://lucit-systems-and-development.github.io/unicorn-bina... | 46.648045 | 130 | 0.614731 |
import json
import logging
import requests
import socket
import threading
import time
logger = logging.getLogger(__name__)
class BinanceWebSocketApiRestclient(object):
def __init__(self, manager):
self.manager = manager
self.api_key = False
self.api_secret = False
self.symbol = F... | true | true |
1c38572ef8d952a91c39c221f8b1ab75118fae3b | 536 | py | Python | helloWorldApp/app/__init__.py | OscarPalominoC/cursoFlask | 8f87b8165a45c1c0124184e9866a505def463e44 | [
"MIT"
] | null | null | null | helloWorldApp/app/__init__.py | OscarPalominoC/cursoFlask | 8f87b8165a45c1c0124184e9866a505def463e44 | [
"MIT"
] | null | null | null | helloWorldApp/app/__init__.py | OscarPalominoC/cursoFlask | 8f87b8165a45c1c0124184e9866a505def463e44 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_login import LoginManager
from .config import Config
from .auth import auth
from .models import UserModel
login_manager = LoginManager()
login_manager.login_view = 'auth.login'
@login_manager.user_loader
def load_user(username):
return User... | 20.615385 | 39 | 0.774254 | from flask import Flask
from flask_bootstrap import Bootstrap
from flask_login import LoginManager
from .config import Config
from .auth import auth
from .models import UserModel
login_manager = LoginManager()
login_manager.login_view = 'auth.login'
@login_manager.user_loader
def load_user(username):
return User... | true | true |
1c385763e55768956dcf5c96c892d9d54ca34977 | 31,252 | py | Python | libqtile/backend/wayland/window.py | flexagoon/qtile | ecf79a91da058dc9f8dd032a42e13eac9c2a270d | [
"MIT"
] | null | null | null | libqtile/backend/wayland/window.py | flexagoon/qtile | ecf79a91da058dc9f8dd032a42e13eac9c2a270d | [
"MIT"
] | null | null | null | libqtile/backend/wayland/window.py | flexagoon/qtile | ecf79a91da058dc9f8dd032a42e13eac9c2a270d | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Matt Colligan
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distr... | 34.043573 | 97 | 0.615001 |
from __future__ import annotations
import functools
import typing
import cairocffi
import pywayland
from wlroots import ffi
from wlroots.util.edges import Edges
from wlroots.wlr_types import Box, Texture
from wlroots.wlr_types.layer_shell_v1 import LayerSurfaceV1
from wlroots.wlr_types.xdg_shell import (
XdgPopu... | true | true |
1c3857f5ef43f46f8e2416b7d4d3c2c0e9b2c929 | 3,596 | py | Python | ec2instanceconnectcli/mops.py | Hallian/aws-ec2-instance-connect-cli | 95be70889d8503964071dac227507c090a1bc980 | [
"Apache-2.0"
] | null | null | null | ec2instanceconnectcli/mops.py | Hallian/aws-ec2-instance-connect-cli | 95be70889d8503964071dac227507c090a1bc980 | [
"Apache-2.0"
] | null | null | null | ec2instanceconnectcli/mops.py | Hallian/aws-ec2-instance-connect-cli | 95be70889d8503964071dac227507c090a1bc980 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | 44.395062 | 166 | 0.689655 |
import sys
import argparse
from ec2instanceconnectcli.EC2InstanceConnectCLI import EC2InstanceConnectCLI
from ec2instanceconnectcli.EC2InstanceConnectKey import EC2InstanceConnectKey
from ec2instanceconnectcli.EC2InstanceConnectCommand import EC2InstanceConnectCommand
from ec2instanceconnectcli.EC2InstanceConnectLogg... | true | true |
1c38582751f28bdc2dffc5c4099f3b071797762e | 3,755 | py | Python | torch_geometric/datasets/flickr.py | beneisner/pytorch_geometric | 53d44a96bd2de2753b1ab1d7153c026c92606a81 | [
"MIT"
] | 1 | 2022-02-17T09:40:17.000Z | 2022-02-17T09:40:17.000Z | torch_geometric/datasets/flickr.py | beneisner/pytorch_geometric | 53d44a96bd2de2753b1ab1d7153c026c92606a81 | [
"MIT"
] | null | null | null | torch_geometric/datasets/flickr.py | beneisner/pytorch_geometric | 53d44a96bd2de2753b1ab1d7153c026c92606a81 | [
"MIT"
] | 1 | 2021-06-16T11:40:43.000Z | 2021-06-16T11:40:43.000Z | from typing import Optional, Callable, List
import json
import os.path as osp
import torch
import numpy as np
import scipy.sparse as sp
from google_drive_downloader import GoogleDriveDownloader as gdd
from torch_geometric.data import InMemoryDataset, Data
class Flickr(InMemoryDataset):
r"""The Flickr dataset fr... | 38.71134 | 79 | 0.656724 | from typing import Optional, Callable, List
import json
import os.path as osp
import torch
import numpy as np
import scipy.sparse as sp
from google_drive_downloader import GoogleDriveDownloader as gdd
from torch_geometric.data import InMemoryDataset, Data
class Flickr(InMemoryDataset):
adj_full_id = '1crmsTbd1... | true | true |
1c3858d364bdb885edc680b7942cf284a92dde06 | 192 | py | Python | filer_addons/filer_gui/admin/__init__.py | benzkji/django-filer-addons | 0220b1c75520dcda9ec1fe6a46e62a66735c7699 | [
"MIT"
] | null | null | null | filer_addons/filer_gui/admin/__init__.py | benzkji/django-filer-addons | 0220b1c75520dcda9ec1fe6a46e62a66735c7699 | [
"MIT"
] | 23 | 2017-06-17T07:11:07.000Z | 2020-11-06T17:05:05.000Z | filer_addons/filer_gui/admin/__init__.py | benzkji/django-filer-addons | 0220b1c75520dcda9ec1fe6a46e62a66735c7699 | [
"MIT"
] | 2 | 2017-06-20T09:25:09.000Z | 2017-08-03T07:38:17.000Z | from __future__ import unicode_literals
from django.contrib import admin
from .api import FilerGuiAdmin
from ..models import FilerGuiFile
admin.site.register(FilerGuiFile, FilerGuiAdmin)
| 17.454545 | 48 | 0.833333 | from __future__ import unicode_literals
from django.contrib import admin
from .api import FilerGuiAdmin
from ..models import FilerGuiFile
admin.site.register(FilerGuiFile, FilerGuiAdmin)
| true | true |
1c38592f9643bb88ae18a29c8b362c5be017dfa0 | 430 | py | Python | jms_oidc_rp/admin.py | BaiJiangJie/jumpserver-django-oidc-rp | b2d6a63dd82214263b8971412a9043268c31ba7f | [
"MIT"
] | 20 | 2018-04-16T13:17:35.000Z | 2021-06-05T00:08:33.000Z | jms_oidc_rp/admin.py | BaiJiangJie/jumpserver-django-oidc-rp | b2d6a63dd82214263b8971412a9043268c31ba7f | [
"MIT"
] | 9 | 2018-07-20T18:19:13.000Z | 2021-12-22T08:57:18.000Z | oidc_rp/admin.py | bcgov/django-oidc-rp | 50e6fa143e61b04849b4c66beef078be0d7669de | [
"MIT"
] | 21 | 2018-07-10T16:05:44.000Z | 2022-01-24T05:57:09.000Z | """
OpenID Connect relying party (RP) model admin definitions
=========================================================
This module defines admin classes used to populate the Django administration dashboard.
"""
from django.contrib import admin
from .models import OIDCUser
@admin.register(OIDCUser)
cl... | 22.631579 | 91 | 0.616279 |
from django.contrib import admin
from .models import OIDCUser
@admin.register(OIDCUser)
class UserAdmin(admin.ModelAdmin):
list_display = ('sub', 'user', )
| true | true |
1c38594b131a1b460726372bc8e9479ebc4c1a0f | 44,677 | py | Python | classic_heuristics/gapvrp.py | mschmidt87/VeRyPy | 3086288cf203bbe6dc488de72fb6f8ea2a1382e6 | [
"MIT"
] | 1 | 2020-07-14T15:47:07.000Z | 2020-07-14T15:47:07.000Z | classic_heuristics/gapvrp.py | mrwright313/VeRyPy | eaac6e210d861441071565575750a2f0e25dfb72 | [
"MIT"
] | null | null | null | classic_heuristics/gapvrp.py | mrwright313/VeRyPy | eaac6e210d861441071565575750a2f0e25dfb72 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
""" This file is a part of the VeRyPy classical vehicle routing problem
heuristic library and provides an implementation of the Fisher&Jaikumar (1981)
heuristic, which generates an approximate s... | 47.327331 | 168 | 0.583298 |
from __future__ import print_function
from __future__ import division
from signal import signal, SIGINT, default_int_handler
from collections import namedtuple
from math import pi, ceil
from logging import log, DEBUG, WARNING
import numpy as np
from gurobipy import Model, GRB, LinExpr, GurobiError
from tsp_solvers.... | true | true |
1c385a3f212c43b7b143336820cc95534fcd766b | 1,761 | py | Python | src/api/authentication/social_login_signup.py | ThaDeveloper/grind | fa90b65d12e6d9b3d658b132874801ecda08c57f | [
"MIT"
] | 1 | 2019-11-06T22:26:26.000Z | 2019-11-06T22:26:26.000Z | src/api/authentication/social_login_signup.py | ThaDeveloper/grind | fa90b65d12e6d9b3d658b132874801ecda08c57f | [
"MIT"
] | 5 | 2021-03-19T02:49:44.000Z | 2021-06-10T19:13:00.000Z | src/api/authentication/social_login_signup.py | ThaDeveloper/grind | fa90b65d12e6d9b3d658b132874801ecda08c57f | [
"MIT"
] | null | null | null | import uuid
from rest_framework.response import Response
from rest_framework import status
from api.models import User
from api.helpers.get_response import custom_reponse
class SocialAuth:
"""
Logs in/ registers a new social user.
"""
def social_login_signup(self, user_info, **kwargs):
"""
... | 33.865385 | 74 | 0.545713 | import uuid
from rest_framework.response import Response
from rest_framework import status
from api.models import User
from api.helpers.get_response import custom_reponse
class SocialAuth:
def social_login_signup(self, user_info, **kwargs):
try:
user = User.objects.get(email=user_info.get('... | true | true |
1c385a8aa041e66422af67145f40f8881410313a | 4,766 | py | Python | gcloud/core/apis/drf/viewsets/utils.py | qqqqqie/bk-sops | f2e734c2cdac76f89d2e4f0fd7de36168e452141 | [
"Apache-2.0"
] | 881 | 2019-03-25T02:45:42.000Z | 2022-03-30T09:10:49.000Z | gcloud/core/apis/drf/viewsets/utils.py | m0re-work/bk-sops | d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d | [
"Apache-2.0"
] | 3,303 | 2019-03-25T04:18:03.000Z | 2022-03-31T11:52:03.000Z | gcloud/core/apis/drf/viewsets/utils.py | m0re-work/bk-sops | d03ba8a4ee0781c6daaf0dd38a7369dc82669f7d | [
"Apache-2.0"
] | 395 | 2019-03-25T02:53:36.000Z | 2022-03-31T08:37:28.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 38.128 | 118 | 0.672472 | import logging
from iam import Subject, Action, MultiActionRequest
from iam.shortcuts import allow_or_raise_auth_failed
from rest_framework import status
from rest_framework.exceptions import ErrorDetail
from rest_framework.response import Response
from rest_framework.viewsets import GenericViewSet
from gcloud import... | true | true |
1c385d6490b25ea69dde00beb4f6ee638b4d42f2 | 2,032 | py | Python | corus/sources/taiga/nplus1.py | Ilseyar/corus | 61a4776f5e534469bb9df1e451b6a6d5fc0e991b | [
"MIT"
] | 205 | 2019-05-01T07:38:01.000Z | 2022-03-30T04:02:54.000Z | corus/sources/taiga/nplus1.py | Ilseyar/corus | 61a4776f5e534469bb9df1e451b6a6d5fc0e991b | [
"MIT"
] | 78 | 2019-04-29T06:53:53.000Z | 2021-09-20T14:51:25.000Z | corus/sources/taiga/nplus1.py | Ilseyar/corus | 61a4776f5e534469bb9df1e451b6a6d5fc0e991b | [
"MIT"
] | 18 | 2019-06-19T09:56:10.000Z | 2022-01-30T14:55:14.000Z |
from datetime import datetime
from .common import (
Author,
Meta,
load_tar_metas,
load_tar_texts,
patch_month,
merge_metas,
)
# {'author': 'Владимир Королев',
# 'authorreaders': '',
# 'authortexts': '',
# 'date': '21 Янв. 2017',
# 'magazine': '',
# 'segment': 'nplus1',
# 'source'... | 22.577778 | 69 | 0.572835 |
from datetime import datetime
from .common import (
Author,
Meta,
load_tar_metas,
load_tar_texts,
patch_month,
merge_metas,
)
NPLUS1_MONTHS = {
'Янв.': 'Jan',
'Фев.': 'Feb',
'Март': 'Mar',
'Апр.': 'Apr',
'Май': 'May',
'Июнь': 'Jun',
'Июль': 'Jul',
'Авг.': 'A... | true | true |
1c385f91a9b3b361993612243a63eebb6335184b | 6,325 | py | Python | tests.py | badalraina31/snappass | f16106acc7cada1b3f77fddd312faa963e0b6e20 | [
"MIT"
] | null | null | null | tests.py | badalraina31/snappass | f16106acc7cada1b3f77fddd312faa963e0b6e20 | [
"MIT"
] | null | null | null | tests.py | badalraina31/snappass | f16106acc7cada1b3f77fddd312faa963e0b6e20 | [
"MIT"
] | null | null | null | import re
import time
import unittest
import uuid
from unittest import TestCase
from unittest import mock
from urllib.parse import unquote
from cryptography.fernet import Fernet
from freezegun import freeze_time
from werkzeug.exceptions import BadRequest
from fakeredis import FakeStrictRedis
# noinspection PyPep8Nami... | 38.567073 | 106 | 0.655178 | import re
import time
import unittest
import uuid
from unittest import TestCase
from unittest import mock
from urllib.parse import unquote
from cryptography.fernet import Fernet
from freezegun import freeze_time
from werkzeug.exceptions import BadRequest
from fakeredis import FakeStrictRedis
import snappass.main as s... | true | true |
1c3860194879062b51704087b47e5edb5d95420a | 11,828 | py | Python | src/probnum/randprocs/markov/integrator/_iwp.py | alpiges/probnum | 2e4153cb0df559984e09ec74487ef6c9d3f6d464 | [
"MIT"
] | null | null | null | src/probnum/randprocs/markov/integrator/_iwp.py | alpiges/probnum | 2e4153cb0df559984e09ec74487ef6c9d3f6d464 | [
"MIT"
] | 40 | 2021-04-12T07:56:29.000Z | 2022-03-28T00:18:18.000Z | src/probnum/randprocs/markov/integrator/_iwp.py | alpiges/probnum | 2e4153cb0df559984e09ec74487ef6c9d3f6d464 | [
"MIT"
] | null | null | null | """Integrated Brownian motion."""
try:
# cached_property is only available in Python >=3.8
from functools import cached_property
except ImportError:
from cached_property import cached_property
import warnings
import numpy as np
import scipy.special
from probnum import config, linops, randvars
from probn... | 37.07837 | 118 | 0.644234 |
try:
from functools import cached_property
except ImportError:
from cached_property import cached_property
import warnings
import numpy as np
import scipy.special
from probnum import config, linops, randvars
from probnum.randprocs.markov import _markov_process, continuous, discrete
from probnum.randproc... | true | true |
1c386043c55d45b1b88ea0a2646c4901ed16ed5a | 950 | py | Python | distribulator/engine/mode/Mode.py | adace74/test | b7b45fae6c4ba6ffe8a04c45b6e2bf23a918226b | [
"BSD-3-Clause"
] | null | null | null | distribulator/engine/mode/Mode.py | adace74/test | b7b45fae6c4ba6ffe8a04c45b6e2bf23a918226b | [
"BSD-3-Clause"
] | null | null | null | distribulator/engine/mode/Mode.py | adace74/test | b7b45fae6c4ba6ffe8a04c45b6e2bf23a918226b | [
"BSD-3-Clause"
] | null | null | null | ######################################################################
#
# $Id$
#
# (c) Copyright 2004 Orbitz, Inc. All Rights Reserved.
# Please see the accompanying LICENSE file for license information.
#
######################################################################
# Pydoc comments
"""This class is the ba... | 25 | 76 | 0.413684 |
__version__= '$Revision$'[11:-2]
class Mode:
def __init__(self, PassedGlobalConfig):
pass
def invoke(self):
pass
| true | true |
1c38615b6e5a27005bd983f0f82fb8dfb4efac93 | 425 | py | Python | rest/notification/list-get-example-1/list-get-example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2017-11-23T11:31:20.000Z | 2018-01-22T04:14:02.000Z | rest/notification/list-get-example-1/list-get-example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | null | null | null | rest/notification/list-get-example-1/list-get-example-1.5.x.py | azaddeveloper/api-snippets | f88b153cd7186fa70b33733b205886502db0d1f2 | [
"MIT"
] | 2 | 2020-05-22T23:31:21.000Z | 2021-06-10T18:33:45.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)
# A list... | 38.636364 | 72 | 0.828235 | from twilio.rest import TwilioRestClient
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)
notifications = client.notifications.list()
| true | true |
1c38619eee36a6d8e0be87801ad8d87b80681fc2 | 6,617 | py | Python | assignment1/cs231n/classifiers/fc_net.py | qiaw99/CS231n-Convolutional-Neural-Networks-for-Visual-Recognition | 5949b4f68f04e23751879dbc679e7708735d313f | [
"Apache-2.0"
] | null | null | null | assignment1/cs231n/classifiers/fc_net.py | qiaw99/CS231n-Convolutional-Neural-Networks-for-Visual-Recognition | 5949b4f68f04e23751879dbc679e7708735d313f | [
"Apache-2.0"
] | null | null | null | assignment1/cs231n/classifiers/fc_net.py | qiaw99/CS231n-Convolutional-Neural-Networks-for-Visual-Recognition | 5949b4f68f04e23751879dbc679e7708735d313f | [
"Apache-2.0"
] | null | null | null | from builtins import range
from builtins import object
import numpy as np
from ..layers import *
from ..layer_utils import *
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network with ReLU nonlinearity and
softmax loss that uses a modular layer design. We assume an input dimension
... | 47.264286 | 143 | 0.484207 | from builtins import range
from builtins import object
import numpy as np
from ..layers import *
from ..layer_utils import *
class TwoLayerNet(object):
def __init__(
self,
input_dim=3 * 32 * 32,
hidden_dim=100,
num_classes=10,
weight_scale=1e-3,
reg=0.0,
):
... | true | true |
1c3861b42892e0760a2b57f037101b3f9ff8dd62 | 11,482 | py | Python | pcdet/models/roi_heads/voxelrcnn_head.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | pcdet/models/roi_heads/voxelrcnn_head.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | pcdet/models/roi_heads/voxelrcnn_head.py | EmiyaNing/OpenPCDet | 41ff28209cb000b51626a0ed8593b0adbe3dd447 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from ...ops.pointnet2.pointnet2_stack import voxel_pool_modules as voxelpool_stack_modules
from ...utils import common_utils
from .roi_head_template import RoIHeadTemplate
class VoxelRCNNHead(RoIHeadTemplate):
def __init__(self, backbone_channels, model_cfg, point_cloud_range, v... | 45.027451 | 116 | 0.620536 | import torch
import torch.nn as nn
from ...ops.pointnet2.pointnet2_stack import voxel_pool_modules as voxelpool_stack_modules
from ...utils import common_utils
from .roi_head_template import RoIHeadTemplate
class VoxelRCNNHead(RoIHeadTemplate):
def __init__(self, backbone_channels, model_cfg, point_cloud_range, v... | true | true |
1c3861f9352bd1c49f29f5b231e79694c4ccbaae | 1,148 | py | Python | setup.py | anoadragon453/matrix-nio | e157c5fed96d75797bbb0fadaa0c473fe11b5e6a | [
"Apache-2.0"
] | null | null | null | setup.py | anoadragon453/matrix-nio | e157c5fed96d75797bbb0fadaa0c473fe11b5e6a | [
"Apache-2.0"
] | null | null | null | setup.py | anoadragon453/matrix-nio | e157c5fed96d75797bbb0fadaa0c473fe11b5e6a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from os import path
from io import open
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="matrix-nio",
version="0.5",
... | 25.511111 | 78 | 0.585366 |
from os import path
from io import open
from setuptools import find_packages, setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name="matrix-nio",
version="0.5",
url="https://github.... | true | true |
1c386306cbf996ad6e0e5a309be4b1867d2be2d2 | 127 | py | Python | iot_kernel/__main__.py | iot49/iot-kernel | 5eb3e32a7e63b6ce5297cbab3df48d50d45cad50 | [
"MIT"
] | 2 | 2021-07-01T12:32:43.000Z | 2021-12-16T22:21:20.000Z | iot_kernel/__main__.py | iot49/iot-kernel | 5eb3e32a7e63b6ce5297cbab3df48d50d45cad50 | [
"MIT"
] | null | null | null | iot_kernel/__main__.py | iot49/iot-kernel | 5eb3e32a7e63b6ce5297cbab3df48d50d45cad50 | [
"MIT"
] | null | null | null | from ipykernel.kernelapp import IPKernelApp
from .kernel import IoTKernel
IPKernelApp.launch_instance(kernel_class=IoTKernel)
| 25.4 | 51 | 0.874016 | from ipykernel.kernelapp import IPKernelApp
from .kernel import IoTKernel
IPKernelApp.launch_instance(kernel_class=IoTKernel)
| true | true |
1c3864289d1471dfe5e1c5439cfcea90e3d1c2a2 | 1,438 | py | Python | tests/test_filename_checking.py | rcbops/flake8-filename | 1bfb0f6174e11bf6d3750aecddcb8e0216ad645b | [
"Apache-2.0"
] | null | null | null | tests/test_filename_checking.py | rcbops/flake8-filename | 1bfb0f6174e11bf6d3750aecddcb8e0216ad645b | [
"Apache-2.0"
] | 4 | 2018-05-30T14:31:43.000Z | 2020-08-10T08:23:28.000Z | tests/test_filename_checking.py | rcbops/flake8-filename | 1bfb0f6174e11bf6d3750aecddcb8e0216ad645b | [
"Apache-2.0"
] | 4 | 2018-05-25T15:21:38.000Z | 2020-02-22T13:04:24.000Z | # -*- coding: utf-8 -*-
import pytest
# args to only use checks that raise an 'N' prefixed error
extra_args = ['--select', 'N']
config = r"""
[flake8]
filename_check1 = filter_regex=test_.+
filename_regex=test_[\w-]+$
"""
def test_pass_filter_and_match_filename(flake8dir):
"""Verify that no v... | 27.132075 | 114 | 0.698192 |
import pytest
extra_args = ['--select', 'N']
config = r"""
[flake8]
filename_check1 = filter_regex=test_.+
filename_regex=test_[\w-]+$
"""
def test_pass_filter_and_match_filename(flake8dir):
flake8dir.make_setup_cfg(config)
flake8dir.make_file('test_File-10.py', 'import sys')
... | true | true |
1c38649c2ee470c2fd8143faecb7a0b42c0a9261 | 3,292 | py | Python | targets/waxwing/base.py | timvideos/litex-buildenv | a103774342c0265458979a79082b233d9ce08edb | [
"BSD-2-Clause"
] | 198 | 2018-01-17T05:39:54.000Z | 2022-03-15T08:59:16.000Z | targets/waxwing/base.py | timvideos/litex-buildenv | a103774342c0265458979a79082b233d9ce08edb | [
"BSD-2-Clause"
] | 610 | 2017-12-31T01:32:32.000Z | 2022-03-19T22:07:28.000Z | targets/waxwing/base.py | timvideos/litex-buildenv | a103774342c0265458979a79082b233d9ce08edb | [
"BSD-2-Clause"
] | 85 | 2018-01-13T05:51:38.000Z | 2022-02-11T18:54:14.000Z | # Support for the Numato Saturn (http://numato.com/product/saturn-spartan-6-fpga-development-board-with-ddr-sdram)
from fractions import Fraction
from migen import *
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from litex.soc.interconnect import wishbone
from litedram.mo... | 38.729412 | 114 | 0.545869 |
from fractions import Fraction
from migen import *
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from litex.soc.interconnect import wishbone
from litedram.modules import MT46H32M16
from litedram.phy import s6ddrphy
from litedram.core import ControllerSettings
from target... | true | true |
1c3864a2202941f66300375795f86ea08723517c | 9,270 | py | Python | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.789474 | 213 | 0.68123 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.cor... | true | true |
1c3864ebd82b1039ffbfd4ca1a853f561a39ca03 | 15,279 | py | Python | mol_dqn/experimental/multi_obj_opt.py | awesome-archive/google-research | 6b3c751abbf658b33fb03e51d7b84105d2dbea68 | [
"Apache-2.0"
] | 1 | 2019-02-16T12:17:14.000Z | 2019-02-16T12:17:14.000Z | mol_dqn/experimental/multi_obj_opt.py | awesome-archive/google-research | 6b3c751abbf658b33fb03e51d7b84105d2dbea68 | [
"Apache-2.0"
] | null | null | null | mol_dqn/experimental/multi_obj_opt.py | awesome-archive/google-research | 6b3c751abbf658b33fb03e51d7b84105d2dbea68 | [
"Apache-2.0"
] | 1 | 2019-01-27T13:03:12.000Z | 2019-01-27T13:03:12.000Z | # coding=utf-8
# Copyright 2018 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 35.532558 | 80 | 0.70214 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import json
import os
import random
import time
from absl import app
from absl import flags
from absl import logging
from baselines.common import schedules
from baselines.deepq import replay... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.