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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c21b9014a26d7558dda27f98385332a12a585c5 | 3,930 | py | Python | lib/vector_generator.py | blues-lin/Char-level-CNN-for-Chinese-Text-Classification-in-Keras | 81c7cdec48d4b17640e4c5465a4a412e338a7e62 | [
"MIT"
] | 8 | 2017-03-05T04:57:22.000Z | 2021-03-04T04:29:13.000Z | lib/vector_generator.py | blues-lin/Char-level-CNN-for-Chinese-Text-Classification-in-Keras | 81c7cdec48d4b17640e4c5465a4a412e338a7e62 | [
"MIT"
] | null | null | null | lib/vector_generator.py | blues-lin/Char-level-CNN-for-Chinese-Text-Classification-in-Keras | 81c7cdec48d4b17640e4c5465a4a412e338a7e62 | [
"MIT"
] | 1 | 2018-03-07T07:56:33.000Z | 2018-03-07T07:56:33.000Z | """ Generate vector. """
import os.path
import random
import numpy as np
from lib import Vectorizer
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
CHAR_PATH = os.path.join(BASE_PATH, 'data/charTable.txt')
LABEL_PATH = os.path.join(BASE_PATH, 'data/label.txt')
class VectGenerator:
"""
Generate vector... | 33.87931 | 76 | 0.556743 | import os.path
import random
import numpy as np
from lib import Vectorizer
BASE_PATH = os.path.dirname(os.path.realpath(__file__))
CHAR_PATH = os.path.join(BASE_PATH, 'data/charTable.txt')
LABEL_PATH = os.path.join(BASE_PATH, 'data/label.txt')
class VectGenerator:
def __init__(
self, dataList, textL... | true | true |
1c21b9d41b44aa09b1f79801e7eb2e09b386b7c5 | 4,623 | py | Python | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/account_budget_proposal_service/transports/base.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/account_budget_proposal_service/transports/base.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/account_budget_proposal_service/transports/base.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.585366 | 82 | 0.67467 |
import abc
import typing
import pkg_resources
import google.auth
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials
from google.ads.googleads.v7.resources.types import account_budget_proposal
from google.ads.... | true | true |
1c21bad3693b1c0288a278b2feb7565be19dad5a | 34 | py | Python | src/__init__.py | K4th4r1n4/Swiss-Super-League | 8dcfb9085c6142af6843c0c4903ec6fec9732a69 | [
"MIT"
] | null | null | null | src/__init__.py | K4th4r1n4/Swiss-Super-League | 8dcfb9085c6142af6843c0c4903ec6fec9732a69 | [
"MIT"
] | null | null | null | src/__init__.py | K4th4r1n4/Swiss-Super-League | 8dcfb9085c6142af6843c0c4903ec6fec9732a69 | [
"MIT"
] | null | null | null | """The package string.. ToDo :)""" | 34 | 34 | 0.588235 | true | true | |
1c21bb7364c56c97a332e4daa95c98d4198b5f06 | 1,404 | py | Python | ooobuild/dyn/sdbc/x_isolated_connection.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/sdbc/x_isolated_connection.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/sdbc/x_isolated_connection.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... | 37.945946 | 92 | 0.775641 |
from typing import TYPE_CHECKING
from ooo.oenv.env_const import UNO_ENVIRONMENT, UNO_RUNTIME
_DYNAMIC = False
if (not TYPE_CHECKING) and UNO_RUNTIME and UNO_ENVIRONMENT:
_DYNAMIC = True
if not TYPE_CHECKING and _DYNAMIC:
from com.sun.star.sdbc import XIsolatedConnection as XIsolatedConnecti... | true | true |
1c21bb784623698a75a5b673979d57245b2c4b9b | 6,165 | py | Python | util/mgmol2input.py | jeanlucf22/mgmol | 4e79bc32c14c8a47ae18ad0659ea740719c8b77f | [
"BSD-3-Clause-LBNL",
"FSFAP"
] | 25 | 2018-12-29T03:33:01.000Z | 2021-05-08T12:52:27.000Z | util/mgmol2input.py | jeanlucf22/mgmol | 4e79bc32c14c8a47ae18ad0659ea740719c8b77f | [
"BSD-3-Clause-LBNL",
"FSFAP"
] | 121 | 2018-12-19T02:38:21.000Z | 2021-12-20T16:29:24.000Z | util/mgmol2input.py | jeanlucf22/mgmol | 4e79bc32c14c8a47ae18ad0659ea740719c8b77f | [
"BSD-3-Clause-LBNL",
"FSFAP"
] | 15 | 2019-02-17T05:28:43.000Z | 2022-02-28T05:24:11.000Z | # Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
# the Lawrence Livermore National Laboratory.
# LLNL-CODE-743438
# All rights reserved.
# This file is part of MGmol. For details, see https://github.com/llnl/mgmol.
# Please also read this link https://github.com/llnl/mgmol/LICENSE
#
# Python... | 27.522321 | 80 | 0.551176 |
import sys, string
import outputTools
input =open(sys.argv[1],'r')
output=open(sys.argv[2],'r')
Lo =output.readlines()
lo=len(Lo) ':0,'Li':0,'Be':0,'B':0,'C':0,'N':0,'O':0,'F':0,'Na':0,
'Mg':0,'Al':0,'Si':0,'P':0,'S':0,'Cl':0,'Ca':0,'In':0,'Au':0}
j=j+1
break
if... | false | true |
1c21bc204ec0040bf174d632bcdf3676a0352cc6 | 558 | py | Python | example.py | lawlesst/wos2vivo | e0258aa5ccb3acb0924a61bf225f2e6aa439876e | [
"MIT"
] | 6 | 2018-04-06T00:06:27.000Z | 2019-11-06T20:54:09.000Z | example.py | rpritchett/wos2vivo | e0258aa5ccb3acb0924a61bf225f2e6aa439876e | [
"MIT"
] | 5 | 2018-02-23T15:27:29.000Z | 2019-10-30T00:19:32.000Z | example.py | rpritchett/wos2vivo | e0258aa5ccb3acb0924a61bf225f2e6aa439876e | [
"MIT"
] | null | null | null | """
Example usage.
"""
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
from wos2vivo.harvest import get_publications_for_org
from rdflib import Graph
g = Graph()
org_name = "University of Florida"
tspan = dict(begin="2016-03-01", end="2016-03-14")
for pub in get_publicat... | 17.4375 | 75 | 0.663082 | """
Example usage.
"""
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.INFO)
from wos2vivo.harvest import get_publications_for_org
from rdflib import Graph
g = Graph()
org_name = "University of Florida"
tspan = dict(begin="2016-03-01", end="2016-03-14")
for pub in get_publicat... | false | true |
1c21bc865aff52ee557105d567b69761de67857b | 624 | py | Python | actions/urls.py | HelloYeew/beattosetto | f8847fda908b0211c1221ba64854df42274b9db1 | [
"MIT"
] | 5 | 2021-11-02T15:09:24.000Z | 2022-03-24T03:03:57.000Z | actions/urls.py | beattosetto/beattosetto | a4bd93fc1ca7530b73f03194847ab8b0dca86806 | [
"MIT"
] | 205 | 2021-10-12T09:13:59.000Z | 2022-03-10T10:09:07.000Z | actions/urls.py | pontakornth/beattosetto | b3201922a61a9164659efc26f11dc818aa5705f2 | [
"MIT"
] | 2 | 2021-10-12T13:39:01.000Z | 2021-10-13T08:47:59.000Z | """
File contain url path for actions app.
"""
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path('actions/', views.actions, name='actions'),
path('actions/update_beatmap', views.update_beatmap_action, name='actions_... | 34.666667 | 95 | 0.759615 | from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path('actions/', views.actions, name='actions'),
path('actions/update_beatmap', views.update_beatmap_action, name='actions_update_beatmap'),
path('action/action_log/<... | true | true |
1c21bd93f2e41735df2d6586a829315c7b6420e6 | 6,299 | py | Python | graphzoo/models/base_models.py | oom-debugger/GraphZoo-1 | 7ef1184c0016090597e56b8706a87539a3f62fd6 | [
"MIT"
] | 2 | 2022-03-30T01:11:39.000Z | 2022-03-30T11:08:12.000Z | graphzoo/models/base_models.py | oom-debugger/GraphZoo-1 | 7ef1184c0016090597e56b8706a87539a3f62fd6 | [
"MIT"
] | null | null | null | graphzoo/models/base_models.py | oom-debugger/GraphZoo-1 | 7ef1184c0016090597e56b8706a87539a3f62fd6 | [
"MIT"
] | 2 | 2022-01-27T21:03:40.000Z | 2022-03-15T20:20:12.000Z | """
Base model class
"""
import numpy as np
from sklearn.metrics import roc_auc_score, average_precision_score
import torch
import torch.nn as nn
import torch.nn.functional as F
from graphzoo.layers.layers import FermiDiracDecoder
from graphzoo import manifolds
import graphzoo.models.encoders as encoders
from graphzoo.... | 38.882716 | 128 | 0.608827 | import numpy as np
from sklearn.metrics import roc_auc_score, average_precision_score
import torch
import torch.nn as nn
import torch.nn.functional as F
from graphzoo.layers.layers import FermiDiracDecoder
from graphzoo import manifolds
import graphzoo.models.encoders as encoders
from graphzoo.models.decoders import mo... | true | true |
1c21bde4ceeac3ec606a5f68db42e7442e8e0b45 | 2,756 | py | Python | backend/server/apps/endpoints/migrations/0001_initial.py | 3HeadedSnake/ml_service | 37e9dff818db12664cd1131f2559af880b2f8a15 | [
"MIT"
] | null | null | null | backend/server/apps/endpoints/migrations/0001_initial.py | 3HeadedSnake/ml_service | 37e9dff818db12664cd1131f2559af880b2f8a15 | [
"MIT"
] | null | null | null | backend/server/apps/endpoints/migrations/0001_initial.py | 3HeadedSnake/ml_service | 37e9dff818db12664cd1131f2559af880b2f8a15 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-13 14:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Endpoint',
fields=[
... | 45.180328 | 154 | 0.587808 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Endpoint',
fields=[
('id', models.AutoField(auto_created=... | true | true |
1c21c0ab456f4b133fce7dcf453202601191f4d4 | 15,523 | py | Python | old version/process_csv_ebayPythonV3_V4.3.4.py | mofosyne/python-ebay-csv-processor | 0df19c6859d9ab8f5042c87ba321e01ff4dad3fc | [
"MIT"
] | 3 | 2017-08-11T04:23:54.000Z | 2017-08-23T07:24:02.000Z | old version/process_csv_ebayPythonV3_V4.3.4.py | mofosyne/python-ebay-csv-processor | 0df19c6859d9ab8f5042c87ba321e01ff4dad3fc | [
"MIT"
] | null | null | null | old version/process_csv_ebayPythonV3_V4.3.4.py | mofosyne/python-ebay-csv-processor | 0df19c6859d9ab8f5042c87ba321e01ff4dad3fc | [
"MIT"
] | null | null | null | ## About: this process shipping orders from ebay in csv format.
## By: Brian Khuu briankhuu.com
## First started on 2012 Q1
###To use this, just move your SalesHistory.csv to this folder, then run Process_csv_ebay.py
##Note: make sure there is a PackListArchive folder in the same folder as the script
## v4.3.4 -=- A... | 40.319481 | 256 | 0.627843 |
## v2.9 - attept to fix &
## v2.8 - duplicate address detection ( Possibility of saving postage cost )
## v2.7 - fixed multiple quantity alerts message (wasn't displaying before)
x. Autocorrect common mistake in addr2 being used as suburb field, instead of city
## v2.1 - fixing a loading bug and also make it load f... | true | true |
1c21c2f75bad04776244ff31e4e6e1a65d8e8844 | 1,038 | py | Python | BOJ/exaustive_search/n_m_8.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/exaustive_search/n_m_8.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | BOJ/exaustive_search/n_m_8.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | """
재귀 함수
함수가 하는 작업을 조각내어 그 일부를 완벽히 해결하여 부분답을 도출해 낸후, 나머지를 자기 자신에게 넘겨주어 해를 구성
재귀함수의 조건
1. 문제의 분할
- 함수가 하는 작업을 가장 자연스럽게 조각낼 수 있는 방식 찾기
2. 기저사례의 선택
- 더 이상이 탐색이 필요 없이 답을 도출해 낼 수 있는 조건 선택
3. 자기 자신을 완벽하게 해결
- 부분 답을 구성할 수 있는 조건 선택 및 해에 부분 답을 더함
"""
import sys
def solve(numbers, m, arr):
string = "" # 조건을 만족하지 못할 때는... | 25.317073 | 67 | 0.573218 |
import sys
def solve(numbers, m, arr):
string = ""
if len(arr) == m:
for i in range(len(arr)):
string += str(arr[i])
if i < len(arr):
string += " "
string += "\n"
return string
for i in range(len(numbers)):
if not arr or ar... | true | true |
1c21c38f6c9879236e75fb522023bb7c9953cecd | 7,528 | py | Python | soccer/gameplay/plays/restarts/basic_offensive_indirect.py | akhilveeraghanta/robocup-software | 8ed909cf54317f176b4ba71369532897228af4c9 | [
"Apache-2.0"
] | null | null | null | soccer/gameplay/plays/restarts/basic_offensive_indirect.py | akhilveeraghanta/robocup-software | 8ed909cf54317f176b4ba71369532897228af4c9 | [
"Apache-2.0"
] | null | null | null | soccer/gameplay/plays/restarts/basic_offensive_indirect.py | akhilveeraghanta/robocup-software | 8ed909cf54317f176b4ba71369532897228af4c9 | [
"Apache-2.0"
] | null | null | null | import main
import robocup
import behavior
import constants
import standard_play
import skills.line_kick
import tactics.coordinated_pass
import enum
import skills.move
import random
from situations import Situation
## A basic play for the Offensive Indect kick
# Chooses to pass to a close or far robot
# If it chooses... | 38.804124 | 109 | 0.61517 | import main
import robocup
import behavior
import constants
import standard_play
import skills.line_kick
import tactics.coordinated_pass
import enum
import skills.move
import random
from situations import Situation
ard_play.StandardPlay):
_situationList = [
Situation.OFFENSIVE_KICK
]
class Stat... | true | true |
1c21c49d080fec66f9b42a36ed6160912a3fe8fb | 3,428 | py | Python | docker-jans-config-api/scripts/utils.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | null | null | null | docker-jans-config-api/scripts/utils.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | 60 | 2020-11-16T14:21:58.000Z | 2021-12-21T16:11:12.000Z | docker-jans-config-api/scripts/utils.py | duttarnab/jans | b4ae02f9cb60433a44a2b889268525532d82a247 | [
"Apache-2.0"
] | 1 | 2021-06-17T12:30:10.000Z | 2021-06-17T12:30:10.000Z | import json
import os
from urllib.parse import urlparse
from jans.pycloudlib import get_manager
from jans.pycloudlib.persistence.couchbase import get_couchbase_user
from jans.pycloudlib.persistence.couchbase import get_couchbase_password
from jans.pycloudlib.persistence.couchbase import CouchbaseClient
from jans.pyclo... | 27.206349 | 84 | 0.657526 | import json
import os
from urllib.parse import urlparse
from jans.pycloudlib import get_manager
from jans.pycloudlib.persistence.couchbase import get_couchbase_user
from jans.pycloudlib.persistence.couchbase import get_couchbase_password
from jans.pycloudlib.persistence.couchbase import CouchbaseClient
from jans.pyclo... | true | true |
1c21c6011ba4de7b3dc3741d55dd897df4634e98 | 124 | py | Python | Ethanyan_mall/Ethanyan_mall/apps/users/apps.py | Jaylen0829/E-commerce-sites | faa4443c11d1534642c8dc9f8262f818f489c554 | [
"MIT"
] | 17 | 2019-01-22T00:14:40.000Z | 2022-02-03T12:29:49.000Z | Ethanyan_mall/Ethanyan_mall/apps/users/apps.py | Jaylen0829/E-commerce-sites | faa4443c11d1534642c8dc9f8262f818f489c554 | [
"MIT"
] | 1 | 2020-06-28T15:16:38.000Z | 2020-08-03T15:34:14.000Z | Ethanyan_mall/Ethanyan_mall/apps/users/apps.py | EthanYan6/E-commerce-sites | faa4443c11d1534642c8dc9f8262f818f489c554 | [
"MIT"
] | 11 | 2020-02-24T00:22:08.000Z | 2022-03-26T17:03:40.000Z | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
# name = 'Ethanyan_mall.apps.users' | 20.666667 | 39 | 0.717742 | from django.apps import AppConfig
class UsersConfig(AppConfig):
name = 'users'
| true | true |
1c21c67cc0c78d9265d207fbcb3a8d15ab6dd3a9 | 8,368 | py | Python | docs/conf.py | ehom/babel | 11a229fea92d38a1826a56447fe92ecf6da81e8a | [
"BSD-3-Clause"
] | 1 | 2020-10-28T20:31:03.000Z | 2020-10-28T20:31:03.000Z | docs/conf.py | ehom/babel | 11a229fea92d38a1826a56447fe92ecf6da81e8a | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | ehom/babel | 11a229fea92d38a1826a56447fe92ecf6da81e8a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Babel documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 3 17:53:01 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 31.81749 | 80 | 0.702677 |
import sys, os
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath('_themes'))
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.extlinks']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'ind... | true | true |
1c21c687ee19f672e76ecbf488156daf2db1d05b | 3,331 | py | Python | httpDissec.py | alexst07/http_dissector | 851e12c9be459ab6e7af15d55034c2a8846b9c46 | [
"MIT"
] | null | null | null | httpDissec.py | alexst07/http_dissector | 851e12c9be459ab6e7af15d55034c2a8846b9c46 | [
"MIT"
] | null | null | null | httpDissec.py | alexst07/http_dissector | 851e12c9be459ab6e7af15d55034c2a8846b9c46 | [
"MIT"
] | null | null | null | # sudo apt-get install python-scapy
from scapy.all import *
# sudo pip install scapy_http
from scapy.layers import http
from scapy.layers.http import HTTPResponse
import sys
import os
import optparse
def has_http_header(packet):
return packet.haslayer(HTTPResponse)
def transfering_chunked(packet):
httpLayer ... | 25.045113 | 74 | 0.648454 |
from scapy.all import *
from scapy.layers import http
from scapy.layers.http import HTTPResponse
import sys
import os
import optparse
def has_http_header(packet):
return packet.haslayer(HTTPResponse)
def transfering_chunked(packet):
httpLayer = packet['HTTP Response']
return ('Transfer-Encoding' in htt... | false | true |
1c21c6d62e40a78256883d107e9e70537fdfeebe | 1,013 | py | Python | tests/storage/servers/fastmail/__init__.py | AlecPapierniak/vdirsyncer | 27ebb0902bba66c2d26f892353bf6f05e849fe81 | [
"BSD-3-Clause"
] | 1 | 2020-09-29T14:42:08.000Z | 2020-09-29T14:42:08.000Z | tests/storage/servers/fastmail/__init__.py | AlecPapierniak/vdirsyncer | 27ebb0902bba66c2d26f892353bf6f05e849fe81 | [
"BSD-3-Clause"
] | null | null | null | tests/storage/servers/fastmail/__init__.py | AlecPapierniak/vdirsyncer | 27ebb0902bba66c2d26f892353bf6f05e849fe81 | [
"BSD-3-Clause"
] | 1 | 2020-09-30T08:36:36.000Z | 2020-09-30T08:36:36.000Z | import os
import pytest
class ServerMixin:
@pytest.fixture
def get_storage_args(self, item_type, slow_create_collection):
if item_type == "VTODO":
# Fastmail has non-standard support for TODOs
# See https://github.com/pimutils/vdirsyncer/issues/824
pytest.skip("Fas... | 31.65625 | 83 | 0.569595 | import os
import pytest
class ServerMixin:
@pytest.fixture
def get_storage_args(self, item_type, slow_create_collection):
if item_type == "VTODO":
pytest.skip("Fastmail has non-standard VTODO support.")
def inner(collection="test"):
args = {
... | true | true |
1c21c958f36b655541f1bc04ab7ce7ecdb2ed047 | 284 | py | Python | goal.py | bmintz/python-snippets | 982861c173bf4bcd5d908514a9e8b1914a580a5d | [
"CC0-1.0"
] | 2 | 2018-11-12T10:33:13.000Z | 2019-02-24T05:01:40.000Z | goal.py | LyricLy/python-snippets | 9d868b7bbccd793ea1dc513f51290963584a1dee | [
"CC0-1.0"
] | null | null | null | goal.py | LyricLy/python-snippets | 9d868b7bbccd793ea1dc513f51290963584a1dee | [
"CC0-1.0"
] | 2 | 2018-11-24T08:16:59.000Z | 2019-02-24T04:41:30.000Z | #!/usr/bin/env python3.6
# encoding: utf-8
def g(end=None):
if not hasattr(g, 'out'):
g.out = 'g'
if not end:
g.out += 'o'
return g
else:
return g.out + end
if __name__ == '__main__':
for result in (
g('al'),
g()('al'),
g()()('al'),
g('al')
):
print(result)
| 12.909091 | 26 | 0.528169 |
def g(end=None):
if not hasattr(g, 'out'):
g.out = 'g'
if not end:
g.out += 'o'
return g
else:
return g.out + end
if __name__ == '__main__':
for result in (
g('al'),
g()('al'),
g()()('al'),
g('al')
):
print(result)
| true | true |
1c21c975f4f15c55725ebe80dc50dee85f58bef4 | 15,736 | py | Python | linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/UI/Pygame/Ticker.py | mdavid/nuxleus | 653f1310d8bf08eaa5a7e3326c2349e56a6abdc2 | [
"BSD-3-Clause"
] | 1 | 2017-03-28T06:41:51.000Z | 2017-03-28T06:41:51.000Z | linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/UI/Pygame/Ticker.py | mdavid/nuxleus | 653f1310d8bf08eaa5a7e3326c2349e56a6abdc2 | [
"BSD-3-Clause"
] | null | null | null | linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/UI/Pygame/Ticker.py | mdavid/nuxleus | 653f1310d8bf08eaa5a7e3326c2349e56a6abdc2 | [
"BSD-3-Clause"
] | 1 | 2016-12-13T21:08:58.000Z | 2016-12-13T21:08:58.000Z | #!/usr/bin/python
#
# Copyright (C) 2005 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser Gener... | 42.074866 | 129 | 0.588587 |
import pygame
import Axon
from Kamaelia.UI.GraphicDisplay import PygameDisplay
from Axon.Ipc import WaitComplete
import time
class Ticker(Axon.Component.component):
Inboxes = { "inbox" : "Specify (new) filename",
"control" ... | true | true |
1c21c987a0c65a7ee897d8ba89d463afdbcb8030 | 3,693 | py | Python | python_scripts/thermostat_update.py | gouthamravee/ha-thermostat-update | 08d0fc6359a80c86c00642889726132b8c538320 | [
"Apache-2.0"
] | 11 | 2019-10-08T20:36:38.000Z | 2022-01-02T11:34:45.000Z | python_scripts/thermostat_update.py | gouthamravee/ha-thermostat-update | 08d0fc6359a80c86c00642889726132b8c538320 | [
"Apache-2.0"
] | null | null | null | python_scripts/thermostat_update.py | gouthamravee/ha-thermostat-update | 08d0fc6359a80c86c00642889726132b8c538320 | [
"Apache-2.0"
] | 3 | 2020-11-30T10:38:12.000Z | 2021-02-26T03:15:45.000Z | """
This script updates Z-Wave thermostats (e.g. Danfoss 014G0013) state and current
temperature from external sensor.
Arguments:
- thermostat - thermostat entity_id (required)
- sensor - sensor entity_id (required)
- heat_state - name of heating state, default 'heat' (optional), changing
... | 38.873684 | 87 | 0.665042 | ATTR_THERMOSTAT = "thermostat"
ATTR_SENSOR = "sensor"
ATTR_HEAT_STATE = "heat_state"
ATTR_IDLE_STATE = "idle_state"
ATTR_IDLE_HEAT_TEMP = "idle_heat_temp"
ATTR_STATE_ONLY = "state_only"
ATTR_TEMP_ONLY = "temp_only"
ATTR_CURRENT_TEMP = "current_temperature"
ATTR_HVAC_MODES = "hvac_modes"
ATTR_HVAC_MODE = "hvac_mode"
ATT... | true | true |
1c21c9b18f46b8285f35b36fca06e3d261a34ea4 | 5,781 | py | Python | pdf4me/Pdf4mePythonClientApi/pdf4me/model/usage_subscription_res.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | 1 | 2020-06-30T22:18:17.000Z | 2020-06-30T22:18:17.000Z | pdf4me/Pdf4mePythonClientApi/pdf4me/model/usage_subscription_res.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | null | null | null | pdf4me/Pdf4mePythonClientApi/pdf4me/model/usage_subscription_res.py | pdf4me/pdf4me-clientapi-python | 17a1c1baae861369084d658475be56be42ca92d0 | [
"MIT"
] | 1 | 2018-07-10T17:40:37.000Z | 2018-07-10T17:40:37.000Z | # coding: utf-8
"""
Pdf4me
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class... | 29.798969 | 120 | 0.616329 |
import pprint
import re
import six
class UsageSubscriptionRes(object):
swagger_types = {
'usage_subscription_list': 'list[UsageSubscription]',
'trace_id': 'str',
'job_id': 'str',
'subscription_usage': 'SubscriptionUsage'
}
attribute_map = {
'usage_subscript... | true | true |
1c21ca31eeb30bf186a64c6a1459aa06814f4d9a | 299 | py | Python | release/stubs.min/System/Runtime/InteropServices/__init___parts/EXCEPINFO.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Runtime/InteropServices/__init___parts/EXCEPINFO.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Runtime/InteropServices/__init___parts/EXCEPINFO.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class EXCEPINFO(object):
""" Use System.Runtime.InteropServices.ComTypes.EXCEPINFO instead. """
bstrDescription = None
bstrHelpFile = None
bstrSource = None
dwHelpContext = None
pfnDeferredFillIn = None
pvReserved = None
wCode = None
wReserved = None
| 24.916667 | 75 | 0.662207 | class EXCEPINFO(object):
bstrDescription = None
bstrHelpFile = None
bstrSource = None
dwHelpContext = None
pfnDeferredFillIn = None
pvReserved = None
wCode = None
wReserved = None
| true | true |
1c21ca4f61d580893256a7848e6485415c4b0fa0 | 1,279 | py | Python | src/table_filter.py | LAfihq/SETool | 476c2fea76708bdb3c7e49de1b549ba0db795884 | [
"MIT"
] | 4 | 2021-01-03T05:59:29.000Z | 2021-02-14T23:49:00.000Z | src/table_filter.py | LAfihq/SETool | 476c2fea76708bdb3c7e49de1b549ba0db795884 | [
"MIT"
] | null | null | null | src/table_filter.py | LAfihq/SETool | 476c2fea76708bdb3c7e49de1b549ba0db795884 | [
"MIT"
] | 2 | 2021-01-03T06:45:20.000Z | 2021-03-31T06:29:08.000Z |
from dash.dependencies import Input, Output
operators = [['ge ', '>='],
['le ', '<='],
['lt ', '<'],
['gt ', '>'],
['ne ', '!='],
['eq ', '='],
['contains '],
['datestartswith ']]
def split_filter_part(filter_part):
'''
... | 31.195122 | 79 | 0.454261 |
from dash.dependencies import Input, Output
operators = [['ge ', '>='],
['le ', '<='],
['lt ', '<'],
['gt ', '>'],
['ne ', '!='],
['eq ', '='],
['contains '],
['datestartswith ']]
def split_filter_part(filter_part):
for ... | true | true |
1c21cad680ffd096ef91d53f65f221d2addd5124 | 3,440 | py | Python | openGaussBase/testcase/SQL/FULL_TEXT_SEARCH/text_match/Opengauss_Function_Text_Match_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/FULL_TEXT_SEARCH/text_match/Opengauss_Function_Text_Match_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/FULL_TEXT_SEARCH/text_match/Opengauss_Function_Text_Match_Case0006.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 37.391304 | 84 | 0.605233 | import os
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.Common import Common
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Logger import Logger
logger = Logger()
class FullTextSearch(unittest.TestCase):
def setUp(self):
logger.info('--------... | true | true |
1c21cb669ea8e1199669325367cab9fd9b8068df | 3,395 | py | Python | python3/struct/struct1.py | jtraver/dev | c7cd2181594510a8fa27e7325566ed2d79371624 | [
"MIT"
] | null | null | null | python3/struct/struct1.py | jtraver/dev | c7cd2181594510a8fa27e7325566ed2d79371624 | [
"MIT"
] | null | null | null | python3/struct/struct1.py | jtraver/dev | c7cd2181594510a8fa27e7325566ed2d79371624 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#!/usr/bin/python
import struct
#
# A basic example of packing/unpacking three integers:
#
# >>>
# >>> from struct import *
# >>> pack('hhl', 1, 2, 3)
# '\x00\x01\x00\x02\x00\x00\x00\x03'
# >>> unpack('hhl', '\x00\x01\x00\x02\x00\x00\x00\x03')
# (1, 2, 3)
# >>> calcsize('hhl')
# 8
# Unpacked ... | 26.523438 | 135 | 0.567599 |
import struct
p1 = struct.pack('hhl', 1, 2, 3)
u1 = struct.unpack('hhl', p1)
print("u1 = %s" % str(u1))
s1 = struct.calcsize('hhl')
print("s1 = %s" % str(s1))
def do_pack(fmt, *args):
print()
print("------------------------------------------------------------------... | true | true |
1c21cc136144472d940edbe9d285f4031fca0f7e | 1,072 | py | Python | scripts/plugin_staging.py | cgconf/galaxy | 82523528f2b90447df5c47cbfc54bf03f462961c | [
"CC-BY-3.0"
] | null | null | null | scripts/plugin_staging.py | cgconf/galaxy | 82523528f2b90447df5c47cbfc54bf03f462961c | [
"CC-BY-3.0"
] | 4 | 2021-03-09T10:04:07.000Z | 2022-03-02T04:37:34.000Z | scripts/plugin_staging.py | cgconf/galaxy | 82523528f2b90447df5c47cbfc54bf03f462961c | [
"CC-BY-3.0"
] | null | null | null | import glob
import os
import shutil
GXY_ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
def link_up_static(f):
src = os.path.join(GXY_ROOT, 'config/plugins', f)
dest = os.path.join(GXY_ROOT, 'static/plugins', f)
dest_parent = os.path.abspath(os.path.join(dest,... | 36.965517 | 143 | 0.663246 | import glob
import os
import shutil
GXY_ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
def link_up_static(f):
src = os.path.join(GXY_ROOT, 'config/plugins', f)
dest = os.path.join(GXY_ROOT, 'static/plugins', f)
dest_parent = os.path.abspath(os.path.join(dest,... | true | true |
1c21cc5d89a2d4c33bbcda06db97f4fa470a2b68 | 19,369 | py | Python | model/proposal_generator.py | valterlej/CustomBMT | c9326752d1355c81f845f2caab9c047be76067de | [
"MIT"
] | 157 | 2020-06-02T18:52:33.000Z | 2022-03-20T16:37:00.000Z | model/proposal_generator.py | valterlej/CustomBMT | c9326752d1355c81f845f2caab9c047be76067de | [
"MIT"
] | 33 | 2020-06-08T09:57:20.000Z | 2021-12-28T07:07:59.000Z | model/proposal_generator.py | valterlej/CustomBMT | c9326752d1355c81f845f2caab9c047be76067de | [
"MIT"
] | 38 | 2020-06-08T07:52:52.000Z | 2022-02-21T16:58:27.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from model.encoders import BiModalEncoder, Encoder
from utilities.proposal_utils import add_dict_to_another_dict, select_topk_predictions, tiou_vectorized
from model.blocks import Transpose, FeatureEmbedder, Identity, PositionalEncoder
class Proposa... | 43.138085 | 117 | 0.60886 | import torch
import torch.nn as nn
import torch.nn.functional as F
from model.encoders import BiModalEncoder, Encoder
from utilities.proposal_utils import add_dict_to_another_dict, select_topk_predictions, tiou_vectorized
from model.blocks import Transpose, FeatureEmbedder, Identity, PositionalEncoder
class Proposa... | true | true |
1c21cd4141067f06a851de72e394e9038893e596 | 4,969 | py | Python | zat/utils/cache.py | maxrp/zat | c8983b1426675d557820cca7be93107d13925076 | [
"Apache-2.0"
] | 1 | 2020-10-06T02:01:31.000Z | 2020-10-06T02:01:31.000Z | zat/utils/cache.py | ewdlop/zat | cd3bcf7319c49babee84ac84358412f87733f703 | [
"Apache-2.0"
] | null | null | null | zat/utils/cache.py | ewdlop/zat | cd3bcf7319c49babee84ac84358412f87733f703 | [
"Apache-2.0"
] | null | null | null | """Cache class for key/value pairs"""
from __future__ import print_function
import time
from collections import OrderedDict
import pickle
import atexit
# Local imports
from zat.utils import file_storage
class Cache(object):
"""In process memory cache. Not thread safe.
Usage:
cache = Cache(max_... | 27.153005 | 88 | 0.591467 | from __future__ import print_function
import time
from collections import OrderedDict
import pickle
import atexit
from zat.utils import file_storage
class Cache(object):
def __init__(self, max_size=1000, timeout=None, load=None):
self.disk_storage = file_storage.FileStorage()
self.load = load
... | true | true |
1c21cd4a7680f0bb13bf4d00c8dba7bb7119b50e | 1,257 | py | Python | scripts/co/bogota.py | PierreMesure/openaddresses | 1e9832486bb093ecf40647897c3f2e76d243129e | [
"BSD-3-Clause"
] | 2,430 | 2015-01-04T02:36:04.000Z | 2022-03-31T02:49:11.000Z | scripts/co/bogota.py | PierreMesure/openaddresses | 1e9832486bb093ecf40647897c3f2e76d243129e | [
"BSD-3-Clause"
] | 4,505 | 2015-01-01T00:24:28.000Z | 2022-03-29T18:51:53.000Z | scripts/co/bogota.py | PierreMesure/openaddresses | 1e9832486bb093ecf40647897c3f2e76d243129e | [
"BSD-3-Clause"
] | 1,063 | 2015-01-01T22:35:22.000Z | 2022-03-27T09:53:18.000Z | import json
import math
import sys
import logging
from esridump.dumper import EsriDumper
logging.basicConfig(level=logging.DEBUG)
outfile_name = sys.argv[1] if len(sys.argv) > 1 else 'bogota.geojson'
d = EsriDumper('http://serviciosgis.catastrobogota.gov.co/arcgis/rest/services/Mapa_Referencia/Mapa_Referencia/MapSe... | 29.928571 | 201 | 0.652347 | import json
import math
import sys
import logging
from esridump.dumper import EsriDumper
logging.basicConfig(level=logging.DEBUG)
outfile_name = sys.argv[1] if len(sys.argv) > 1 else 'bogota.geojson'
d = EsriDumper('http://serviciosgis.catastrobogota.gov.co/arcgis/rest/services/Mapa_Referencia/Mapa_Referencia/MapSe... | true | true |
1c21cd771a0a43c813eff96923051401cc2d57c5 | 34,795 | py | Python | LIB/bert/run_classifier.py | thusithaC/QGforQA | 07f815a1bd49fe1b884a2c615d5986dbfda8677d | [
"MIT"
] | 95 | 2019-08-30T21:30:38.000Z | 2021-12-30T13:35:39.000Z | LIB/bert/run_classifier.py | donshen/QGforQA | 81beed7122abbf9a62745af8ab7d6d4d4bf52c73 | [
"MIT"
] | 15 | 2019-11-02T11:48:35.000Z | 2020-11-13T17:37:07.000Z | LIB/bert/run_classifier.py | donshen/QGforQA | 81beed7122abbf9a62745af8ab7d6d4d4bf52c73 | [
"MIT"
] | 19 | 2019-11-07T05:24:36.000Z | 2021-10-13T13:13:04.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 35.360772 | 82 | 0.681391 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import csv
import os
import modeling
import optimization
import tensorflow as tf
from bert import tokenization
flags = tf.flags
FLAGS = flags.FLAGS
"data_dir", None,
... | true | true |
1c21ce273f4743b99f21dea2f7126b3040798a00 | 6,941 | py | Python | blocks/BlockConnector.py | go2net/PythonBlocks | 4d42121e4af850ba1bf9a4140c11fe10ba218cdd | [
"MIT"
] | 9 | 2015-10-06T05:36:20.000Z | 2019-04-21T12:13:35.000Z | blocks/BlockConnector.py | go2net/PythonBlocks | 4d42121e4af850ba1bf9a4140c11fe10ba218cdd | [
"MIT"
] | null | null | null | blocks/BlockConnector.py | go2net/PythonBlocks | 4d42121e4af850ba1bf9a4140c11fe10ba218cdd | [
"MIT"
] | 2 | 2015-10-07T15:52:37.000Z | 2020-04-27T12:36:20.000Z | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: A21059
#
# Created: 04/03/2015
# Copyright: (c) A21059 2015
# Licence: <your licence>
#-------------------------------------------------------------------------------
def enum(*... | 29.53617 | 120 | 0.594583 |
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
class BlockConnector():
TRIANGLE_1 = 1
TRIANGLE_2 = 2
TRIANGLE_3 = 3
CIRCLE_1 = 4
CIRCLE_2 = 5
CIRCLE_3 = 6
SQUARE_1 = 7
SQUARE_2 = 8
SQ... | true | true |
1c21ce70ab1ee9062061830e194357b611c234b5 | 9,966 | py | Python | ElementaryRLAgent.py | amjal/Smart-Irrigation-using-Reinforcement-Learning | efa8c8adf42cdeaab77e1107a02015a62bb38f04 | [
"MIT"
] | 1 | 2020-12-15T13:48:11.000Z | 2020-12-15T13:48:11.000Z | ElementaryRLAgent.py | amjal/Smart-Irrigation-using-Reinforcement-Learning | efa8c8adf42cdeaab77e1107a02015a62bb38f04 | [
"MIT"
] | 1 | 2021-04-21T06:25:48.000Z | 2021-04-22T21:37:09.000Z | ElementaryRLAgent.py | amjal/Smart-Irrigation-using-Reinforcement-Learning | efa8c8adf42cdeaab77e1107a02015a62bb38f04 | [
"MIT"
] | null | null | null | import numpy
import random
import math
import copy
import requests
import time
# TODO use heuristic in pick_random action
class Action:
def __init__(self, intensity):
self.intensity = int(intensity)
def __eq__(self, other):
return self.intensity == other.intensity
def __ne__(self, other... | 48.614634 | 123 | 0.675095 | import numpy
import random
import math
import copy
import requests
import time
class Action:
def __init__(self, intensity):
self.intensity = int(intensity)
def __eq__(self, other):
return self.intensity == other.intensity
def __ne__(self, other):
return not self.__eq__(other)
... | true | true |
1c21d0c4fc7303847c0d712f51a6784e2ee6b438 | 2,093 | py | Python | experiments/DDPG_offset.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | 4 | 2020-10-11T01:30:13.000Z | 2021-04-27T16:03:41.000Z | experiments/DDPG_offset.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | experiments/DDPG_offset.py | june6723/sumo-rl-offset | 775cddc8d168fb7c4959610a96a791d746fa0afd | [
"MIT"
] | null | null | null | import argparse
import os
import sys
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
import pandas as pd
import ray
from ray.rllib.agents.ddpg.ddpg import DDPGTrainer
from ray.rl... | 41.039216 | 180 | 0.576684 | import argparse
import os
import sys
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
import pandas as pd
import ray
from ray.rllib.agents.ddpg.ddpg import DDPGTrainer
from ray.rl... | true | true |
1c21d2c3e52a14d0bf418d39684bf27be756707a | 2,074 | py | Python | examples/classic_controllers/controllers/flux_observer.py | RaviPandey33/gym-electric-motor-1 | 999e18dceed709decf43d646fb29dc7602b9a89c | [
"MIT"
] | null | null | null | examples/classic_controllers/controllers/flux_observer.py | RaviPandey33/gym-electric-motor-1 | 999e18dceed709decf43d646fb29dc7602b9a89c | [
"MIT"
] | null | null | null | examples/classic_controllers/controllers/flux_observer.py | RaviPandey33/gym-electric-motor-1 | 999e18dceed709decf43d646fb29dc7602b9a89c | [
"MIT"
] | null | null | null | import numpy as np
class FluxObserver:
"""
This class represents a rotor flux observer for an induction motor base on a current model. Further information
can be found at https://ieeexplore.ieee.org/document/4270863.
"""
def __init__(self, env):
mp = env.physical_system.electrical_... | 39.132075 | 119 | 0.615718 | import numpy as np
class FluxObserver:
def __init__(self, env):
mp = env.physical_system.electrical_motor.motor_parameter
self.l_m = mp['l_m']
self.l_r = mp['l_m'] + mp['l_sigr']
self.r_r = mp['r_r']
self.p = mp['p'] ... | true | true |
1c21d2d2e1c59bb0e6db62e6deaca3283b3b4b5f | 703 | py | Python | py/solutions/goorm/escape_room.py | aid95/algorithm-diary | ee7df895761b095d02a08f762c682af5b93add4b | [
"MIT"
] | null | null | null | py/solutions/goorm/escape_room.py | aid95/algorithm-diary | ee7df895761b095d02a08f762c682af5b93add4b | [
"MIT"
] | null | null | null | py/solutions/goorm/escape_room.py | aid95/algorithm-diary | ee7df895761b095d02a08f762c682af5b93add4b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
rl = sys.stdin.readline
def binary_search(arr: list[int], target: int) -> bool:
low, high = 0, len(arr) - 1
while low <= high:
mid = (low + high) // 2
if arr[mid] > target:
high = mid - 1
if arr[mid] == target:
return True
... | 20.676471 | 55 | 0.489331 |
import sys
rl = sys.stdin.readline
def binary_search(arr: list[int], target: int) -> bool:
low, high = 0, len(arr) - 1
while low <= high:
mid = (low + high) // 2
if arr[mid] > target:
high = mid - 1
if arr[mid] == target:
return True
if arr[mid] < targ... | true | true |
1c21d51413a7311c8891874c4abe86f21d0a128d | 2,576 | py | Python | e2e/test_users.py | lukdz/oncall | 4df9b85c1dc1f53659bc1c9f6d56d3eee319fcae | [
"BSD-2-Clause"
] | 857 | 2017-05-03T00:59:10.000Z | 2022-03-29T06:45:23.000Z | e2e/test_users.py | lukdz/oncall | 4df9b85c1dc1f53659bc1c9f6d56d3eee319fcae | [
"BSD-2-Clause"
] | 142 | 2017-05-03T02:00:58.000Z | 2022-03-25T20:58:11.000Z | e2e/test_users.py | lukdz/oncall | 4df9b85c1dc1f53659bc1c9f6d56d3eee319fcae | [
"BSD-2-Clause"
] | 218 | 2017-05-03T02:04:56.000Z | 2022-03-25T18:28:04.000Z | # Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
import json
from testutils import prefix, api_v0
def test_api_v0_users():
user_name = 'test_... | 32.2 | 122 | 0.658773 |
import requests
import json
from testutils import prefix, api_v0
def test_api_v0_users():
user_name = 'test_v0_users_user'
def clean_up():
requests.delete(api_v0('users/'+user_name))
clean_up()
re = requests.post(api_v0('users'), json={'name': user_name})
assert re.status_cod... | true | true |
1c21d5e3141003c928611bf0e85d9a5ea273c6e6 | 983 | py | Python | thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t013parser.py | mail2nsrajesh/congress | a724dfb59c43a5e88e2b03e714a5f962d6976762 | [
"Apache-2.0"
] | 3,266 | 2017-08-06T16:51:46.000Z | 2022-03-30T07:34:24.000Z | thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t013parser.py | mail2nsrajesh/congress | a724dfb59c43a5e88e2b03e714a5f962d6976762 | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t013parser.py | mail2nsrajesh/congress | a724dfb59c43a5e88e2b03e714a5f962d6976762 | [
"Apache-2.0"
] | 1,449 | 2017-08-06T17:40:59.000Z | 2022-03-31T12:03:24.000Z | import antlr3
import testbase
import unittest
class t013parser(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar()
def testValid(self):
cStream = antlr3.StringStream('foobar')
lexer = self.getLexer(cStream)
tStream = antlr3.CommonTokenStream(lexer)
... | 27.305556 | 70 | 0.645982 | import antlr3
import testbase
import unittest
class t013parser(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar()
def testValid(self):
cStream = antlr3.StringStream('foobar')
lexer = self.getLexer(cStream)
tStream = antlr3.CommonTokenStream(lexer)
... | true | true |
1c21d61f7f6811182a3f20b0951bf4d974bb89bb | 3,375 | py | Python | examples/client_tester.py | Peque/mmsim | b3a78ad0119db6ee8df349a89559ea8006c85db1 | [
"BSD-3-Clause"
] | null | null | null | examples/client_tester.py | Peque/mmsim | b3a78ad0119db6ee8df349a89559ea8006c85db1 | [
"BSD-3-Clause"
] | null | null | null | examples/client_tester.py | Peque/mmsim | b3a78ad0119db6ee8df349a89559ea8006c85db1 | [
"BSD-3-Clause"
] | null | null | null | import struct
import zmq
MAZE_SIZE = 16
ctx = zmq.Context()
req = ctx.socket(zmq.REQ)
req.connect('tcp://127.0.0.1:6574')
def ping():
req.send(b'ping')
return req.recv()
def reset():
req.send(b'reset')
return req.recv()
def read_walls(x, y, direction):
direction = direction[0].upper().enco... | 32.451923 | 76 | 0.634074 | import struct
import zmq
MAZE_SIZE = 16
ctx = zmq.Context()
req = ctx.socket(zmq.REQ)
req.connect('tcp://127.0.0.1:6574')
def ping():
req.send(b'ping')
return req.recv()
def reset():
req.send(b'reset')
return req.recv()
def read_walls(x, y, direction):
direction = direction[0].upper().enco... | true | true |
1c21d8569d45d0cf5bd0fc290876745820793d5b | 4,165 | py | Python | datasets/TFrecords2Dataset.py | jercas/TextBoxes_plusplus_tf | 035a5d202202662e2b1230e05a41d20a044b9145 | [
"Apache-2.0"
] | 3 | 2019-11-12T15:09:20.000Z | 2020-10-16T19:59:57.000Z | datasets/TFrecords2Dataset.py | jercas/TextBoxes_plusplus_tf | 035a5d202202662e2b1230e05a41d20a044b9145 | [
"Apache-2.0"
] | 1 | 2019-07-14T10:06:37.000Z | 2019-07-17T01:57:20.000Z | datasets/TFrecords2Dataset.py | jercas/TextBoxes_plusplus_tf | 035a5d202202662e2b1230e05a41d20a044b9145 | [
"Apache-2.0"
] | 2 | 2020-10-24T23:59:03.000Z | 2021-05-06T12:02:38.000Z | import os
import glob
import tensorflow as tf
import tensorflow.contrib.slim as slim
"""
Transform the tfrecord to tf.slim data provider format
"""
ITEMS_TO_DESCRIPTIONS = {
'image': 'A color image of varying height and width.',
'shape': 'Shape of the image',
'object/bbox': 'A list of bounding... | 46.277778 | 91 | 0.671789 | import os
import glob
import tensorflow as tf
import tensorflow.contrib.slim as slim
ITEMS_TO_DESCRIPTIONS = {
'image': 'A color image of varying height and width.',
'shape': 'Shape of the image',
'object/bbox': 'A list of bounding boxes, one per each object.',
'object/label': 'A list of lab... | true | true |
1c21db865680a8d6521ee74637069ac430acc7f0 | 3,346 | py | Python | python-client/trustedanalytics/meta/installpath.py | blbarker/atk | bcb747d053e801820233a6439c88a457c8cf2438 | [
"Apache-2.0"
] | 1 | 2016-04-05T21:57:16.000Z | 2016-04-05T21:57:16.000Z | python-client/trustedanalytics/meta/installpath.py | blbarker/atk | bcb747d053e801820233a6439c88a457c8cf2438 | [
"Apache-2.0"
] | null | null | null | python-client/trustedanalytics/meta/installpath.py | blbarker/atk | bcb747d053e801820233a6439c88a457c8cf2438 | [
"Apache-2.0"
] | null | null | null | # vim: set encoding=utf-8
#
# Copyright (c) 2015 Intel Corporation
#
# 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... | 38.022727 | 128 | 0.681411 |
from trustedanalytics.meta.names import entity_type_to_class_name, entity_type_to_baseclass_name, entity_type_to_entity_basetype
class InstallPath(object):
def __init__(self, path=''):
self.full = path
parts = path.split('/')
self.entity_type = parts[0]
self.ent... | true | true |
1c21dc6a07adc796c004ff4fc74c62389e1e3691 | 239,798 | py | Python | tests/test_optimizely.py | graingert/python-sdk | 46651fa238a88a9ba8bf15ddcd69a83c7f645bf2 | [
"Apache-2.0"
] | 1 | 2021-05-22T10:12:58.000Z | 2021-05-22T10:12:58.000Z | tests/test_optimizely.py | GordonSo/python-sdk | 4470ca9b61f35951f54a2b953c55cbfb3a7b1b98 | [
"Apache-2.0"
] | null | null | null | tests/test_optimizely.py | GordonSo/python-sdk | 4470ca9b61f35951f54a2b953c55cbfb3a7b1b98 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2021, Optimizely
# 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, s... | 47.372185 | 120 | 0.621836 |
import json
import mock
from operator import itemgetter
from optimizely import config_manager
from optimizely import decision_service
from optimizely import entities
from optimizely import error_handler
from optimizely import event_builder
from optimizely import exceptions
from optimizely import logger
fr... | true | true |
1c21dc97c83c18ca6c64d696c6fb7890ff12f5d7 | 1,729 | py | Python | tests/test_product.py | lubwamabenja/Store-Manager | 45cb9c7bcc6bc1dd064beaebf48276ab1c70501d | [
"MIT"
] | null | null | null | tests/test_product.py | lubwamabenja/Store-Manager | 45cb9c7bcc6bc1dd064beaebf48276ab1c70501d | [
"MIT"
] | 1 | 2018-10-15T14:20:41.000Z | 2018-10-16T09:52:12.000Z | tests/test_product.py | lubwamabenja/Store-Manager | 45cb9c7bcc6bc1dd064beaebf48276ab1c70501d | [
"MIT"
] | 1 | 2018-10-22T11:51:03.000Z | 2018-10-22T11:51:03.000Z | import unittest
from app import app
import json
class TestProductViews(unittest.TestCase):
def setUp(self):
self.client = app.test_client()
def test_create_a_product(self):
# Tests that a product is created
post_data = ({
'prod_id' : 0,
'prod_name':'crisps',
... | 38.422222 | 70 | 0.603239 | import unittest
from app import app
import json
class TestProductViews(unittest.TestCase):
def setUp(self):
self.client = app.test_client()
def test_create_a_product(self):
post_data = ({
'prod_id' : 0,
'prod_name':'crisps',
'prod_category':'snacks... | true | true |
1c21dcb3fcd7eb7836813e70298fe030515f0822 | 1,322 | py | Python | tests/test_issue_33.py | hugovk/python-terrascript | 08fe185904a70246822f5cfbdc9e64e9769ec494 | [
"BSD-2-Clause"
] | null | null | null | tests/test_issue_33.py | hugovk/python-terrascript | 08fe185904a70246822f5cfbdc9e64e9769ec494 | [
"BSD-2-Clause"
] | null | null | null | tests/test_issue_33.py | hugovk/python-terrascript | 08fe185904a70246822f5cfbdc9e64e9769ec494 | [
"BSD-2-Clause"
] | null | null | null | """Issue 33: Suggestion of syntax to terrascript
terrascript.Terrascript.add() method.
"""
import terrascript
import terrascript.provider
import terrascript.resource
def test_issue_33():
ts = terrascript.Terrascript()
var_access_key = ts.add(terrascript.Variable("access_key"))
assert isinstance(va... | 25.921569 | 79 | 0.603631 |
import terrascript
import terrascript.provider
import terrascript.resource
def test_issue_33():
ts = terrascript.Terrascript()
var_access_key = ts.add(terrascript.Variable("access_key"))
assert isinstance(var_access_key, terrascript.Variable)
var_secret_key = ts.add(terrascript.Variable("secret_k... | true | true |
1c21ddd3a3c93952ef8ed7326739d9820f91762e | 1,042 | py | Python | test/test_skew_horizontal.py | East196/hello-cocos2d | 3337eba2383143ad47593215270a80cebe987e8f | [
"Apache-2.0"
] | 1 | 2017-12-19T07:31:41.000Z | 2017-12-19T07:31:41.000Z | test/test_skew_horizontal.py | East196/hello-cocos2d | 3337eba2383143ad47593215270a80cebe987e8f | [
"Apache-2.0"
] | null | null | null | test/test_skew_horizontal.py | East196/hello-cocos2d | 3337eba2383143ad47593215270a80cebe987e8f | [
"Apache-2.0"
] | null | null | null | from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 0.5, s, t 1, s, q"
tags = "SkewHorizontal"
import pyglet
import cocos
fr... | 23.681818 | 72 | 0.680422 | from __future__ import division, print_function, unicode_literals
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
testinfo = "s, t 0.5, s, t 1, s, q"
tags = "SkewHorizontal"
import pyglet
import cocos
from cocos.director import director
from cocos.actions import *
from cocos.... | true | true |
1c21de4eb58eae6a99ec1b6a8c1654b8c5aaf423 | 17,751 | py | Python | examples/FasterRCNN/data.py | eliberis/tensorpack | e97ce38dad5af583763f836ccc87ba14ea52f813 | [
"Apache-2.0"
] | 2 | 2019-05-21T15:13:34.000Z | 2019-05-24T07:25:41.000Z | examples/FasterRCNN/data.py | charlesjiangxm/tensorpack | f6313a070bca9bff0e6a2760a395b6b2ab7c4a3d | [
"Apache-2.0"
] | null | null | null | examples/FasterRCNN/data.py | charlesjiangxm/tensorpack | f6313a070bca9bff0e6a2760a395b6b2ab7c4a3d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File: data.py
import copy
import itertools
import numpy as np
import cv2
from tabulate import tabulate
from termcolor import colored
from tensorpack.dataflow import (
DataFromList, MapData, MapDataComponent, MultiProcessMapDataZMQ, MultiThreadMapData,
TestDataSpeed, imgaug)
from tens... | 40.900922 | 120 | 0.638837 |
import copy
import itertools
import numpy as np
import cv2
from tabulate import tabulate
from termcolor import colored
from tensorpack.dataflow import (
DataFromList, MapData, MapDataComponent, MultiProcessMapDataZMQ, MultiThreadMapData,
TestDataSpeed, imgaug)
from tensorpack.utils import logger
from tensor... | true | true |
1c21df9563261701b15f4d14823a3f9528b46f88 | 4,088 | py | Python | reid/models/backbone/modules.py | eddielyc/Augmented-Geometric-Distillation | 029973b7ce3c08fa1f0fa4dab27981d2148986a3 | [
"Apache-2.0"
] | 3 | 2022-03-10T05:56:04.000Z | 2022-03-12T07:32:59.000Z | reid/models/backbone/modules.py | eddielyc/Augmented-Geometric-Distillation | 029973b7ce3c08fa1f0fa4dab27981d2148986a3 | [
"Apache-2.0"
] | 1 | 2022-03-10T06:00:19.000Z | 2022-03-24T06:52:23.000Z | reid/models/backbone/modules.py | eddielyc/Augmented-Geometric-Distillation | 029973b7ce3c08fa1f0fa4dab27981d2148986a3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Time : 2020/1/31 14:37
# Author : Yichen Lu
import torch
from copy import deepcopy
import torch.nn as nn
from torch.nn import functional as F
class SELayer(nn.Module):
def __init__(self, channel, reduction=16):
super(SELayer, self).__init__()
self.avg_po... | 34.644068 | 105 | 0.587084 |
import torch
from copy import deepcopy
import torch.nn as nn
from torch.nn import functional as F
class SELayer(nn.Module):
def __init__(self, channel, reduction=16):
super(SELayer, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Sequential(
... | true | true |
1c21dfd03d59f85679d135ae58617ea81cd31152 | 5,807 | py | Python | src/python/grpcio/tests/unit/beta/_face_interface_test.py | CharaD7/grpc | 062ad488881839d2637b7a191ade5b87346b4597 | [
"BSD-3-Clause"
] | 2 | 2018-01-19T12:18:59.000Z | 2019-07-08T15:02:18.000Z | src/python/grpcio/tests/unit/beta/_face_interface_test.py | CharaD7/grpc | 062ad488881839d2637b7a191ade5b87346b4597 | [
"BSD-3-Clause"
] | null | null | null | src/python/grpcio/tests/unit/beta/_face_interface_test.py | CharaD7/grpc | 062ad488881839d2637b7a191ade5b87346b4597 | [
"BSD-3-Clause"
] | 1 | 2019-07-08T15:02:17.000Z | 2019-07-08T15:02:17.000Z | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 41.776978 | 80 | 0.781643 |
import collections
import unittest
from grpc.beta import implementations
from grpc.beta import interfaces
from tests.unit import resources
from tests.unit import test_common as grpc_test_common
from tests.unit.beta import test_utilities
from tests.unit.framework.common import test_constan... | true | true |
1c21dfe870a115f3410bd97391785d7cd86c4161 | 2,151 | py | Python | reaction.py | mcmont/violet | a3f1cd4b39be65d6d3ae9c3a88cb50997f421707 | [
"CC-BY-4.0"
] | null | null | null | reaction.py | mcmont/violet | a3f1cd4b39be65d6d3ae9c3a88cb50997f421707 | [
"CC-BY-4.0"
] | null | null | null | reaction.py | mcmont/violet | a3f1cd4b39be65d6d3ae9c3a88cb50997f421707 | [
"CC-BY-4.0"
] | null | null | null | # Third-party module imports
import indigo as indigo_module
def reaction(smarts_string, mol1, mol2=False):
"""
This is a convenience function that quickly runs a virtual reaction
and return the products.
"""
products = []
try:
# Setup the Indigo library.
# Enable generat... | 31.632353 | 79 | 0.612273 |
import indigo as indigo_module
def reaction(smarts_string, mol1, mol2=False):
products = []
try:
# allow product molecules to be fed back in to be reacted a second
# time around.
indigo = indigo_module.Indigo()
indigo.setOption("rpe-multistep-reactions"... | true | true |
1c21e334e93253e2040bec3d889fc571e8d3466e | 399 | py | Python | FirstStepsInPython/Basics/Exams/6 and 7 April 2019/02. Godzilla vs. Kong.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Basics/Exams/6 and 7 April 2019/02. Godzilla vs. Kong.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Basics/Exams/6 and 7 April 2019/02. Godzilla vs. Kong.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | 1 | 2021-10-07T18:30:42.000Z | 2021-10-07T18:30:42.000Z | budget = float(input())
crew = int(input())
price_clothes = float(input()) * crew
if crew > 150:
price_clothes *= 0.9
expenses = float((budget * 0.1) + price_clothes)
if expenses > budget:
print("Not enough money!")
print(f"Wingard needs {abs(expenses - budget):.2f} leva more.")
else:
print("Action!"... | 24.9375 | 76 | 0.656642 | budget = float(input())
crew = int(input())
price_clothes = float(input()) * crew
if crew > 150:
price_clothes *= 0.9
expenses = float((budget * 0.1) + price_clothes)
if expenses > budget:
print("Not enough money!")
print(f"Wingard needs {abs(expenses - budget):.2f} leva more.")
else:
print("Action!"... | true | true |
1c21e42c54acf6c245d83e8fee249c873d67cd58 | 699 | py | Python | python_backend/testing/_test_server.py | BenLeong0/japanese_vocab_fetcher | c441eaf46c7330f9319216a6321ce8ec8d3de6cc | [
"MIT"
] | null | null | null | python_backend/testing/_test_server.py | BenLeong0/japanese_vocab_fetcher | c441eaf46c7330f9319216a6321ce8ec8d3de6cc | [
"MIT"
] | 2 | 2021-12-26T23:34:02.000Z | 2021-12-26T23:34:11.000Z | python_backend/testing/_test_server.py | BenLeong0/japanese_vocab_fetcher | c441eaf46c7330f9319216a6321ce8ec8d3de6cc | [
"MIT"
] | null | null | null | """
Tests that can be manually run against a live server
ie `coverage run -m pytest testing/_test_server.py -vv`
"""
import json
import pytest # type: ignore
import requests
from testing.dict_typing import FullTestDict
from testing.dicts import TEST_DICTS
API_URL = "http://127.0.0.1:5000/words"
@pytest.fixture... | 23.3 | 66 | 0.736767 |
import json
import pytest
import requests
from testing.dict_typing import FullTestDict
from testing.dicts import TEST_DICTS
API_URL = "http://127.0.0.1:5000/words"
@pytest.fixture(params=TEST_DICTS, ids=lambda d:d['id'])
def test_dict(request):
return request.param
def test_words_endpoint(test_dict: Ful... | true | true |
1c21e4c502b43d60774db9661c446de91acf8668 | 16,313 | py | Python | ndmg/utils/gen_utils.py | luochuankai-JHU/ndmg | 1307cc4dbaf84e33d61b13a6f83f9bcc4e5cfad6 | [
"Apache-2.0"
] | null | null | null | ndmg/utils/gen_utils.py | luochuankai-JHU/ndmg | 1307cc4dbaf84e33d61b13a6f83f9bcc4e5cfad6 | [
"Apache-2.0"
] | 14 | 2018-09-12T15:02:01.000Z | 2019-11-13T16:13:56.000Z | ndmg/utils/gen_utils.py | luochuankai-JHU/ndmg | 1307cc4dbaf84e33d61b13a6f83f9bcc4e5cfad6 | [
"Apache-2.0"
] | 2 | 2018-10-23T21:47:09.000Z | 2019-10-30T00:43:05.000Z | # !/usr/bin/env python
# Copyright 2016 NeuroData (http://neurodata.io)
#
# 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... | 31.431599 | 161 | 0.60933 |
import warnings
warnings.simplefilter("ignore")
from dipy.io import read_bvals_bvecs
from dipy.core.gradients import gradient_table
from subprocess import Popen, PIPE
import subprocess
import numpy as np
import nibabel as nib
import os
import os.path as op
import sys
from nilearn.image import mea... | true | true |
1c21e58b79f995309273a8b73c6deea2bd60ce2a | 8,877 | py | Python | netbox/netbox/views.py | eqvinox/netbox | b3da70c0bbb801beaaff65595664dca0415d1537 | [
"Apache-2.0"
] | 1 | 2019-01-15T21:06:23.000Z | 2019-01-15T21:06:23.000Z | netbox/netbox/views.py | meua/netbox | 21fe7c57d88e102c4ff25f521d32b6ce70868873 | [
"Apache-2.0"
] | null | null | null | netbox/netbox/views.py | meua/netbox | 21fe7c57d88e102c4ff25f521d32b6ce70868873 | [
"Apache-2.0"
] | 1 | 2019-07-03T21:13:56.000Z | 2019-07-03T21:13:56.000Z | from __future__ import unicode_literals
from collections import OrderedDict
from django.db.models import Count
from django.shortcuts import render
from django.views.generic import View
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.views import APIView
fro... | 35.650602 | 120 | 0.61665 | from __future__ import unicode_literals
from collections import OrderedDict
from django.db.models import Count
from django.shortcuts import render
from django.views.generic import View
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.views import APIView
fro... | true | true |
1c21e5d1ad3b9a1781dddb26a041a108b987077c | 3,627 | py | Python | process/triviaqa.py | AngusGLChen/qg | 3ebc5b94348a4c313829a6c71705fbc9dadd8181 | [
"MIT"
] | null | null | null | process/triviaqa.py | AngusGLChen/qg | 3ebc5b94348a4c313829a6c71705fbc9dadd8181 | [
"MIT"
] | null | null | null | process/triviaqa.py | AngusGLChen/qg | 3ebc5b94348a4c313829a6c71705fbc9dadd8181 | [
"MIT"
] | null | null | null | '''
Created on Sep 11, 2017
@author: Angus
'''
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import numpy
import matplotlib.pyplot as plt;
plt.rcdefaults()
from nltk.tokenize import sent_tokenize
def plot(array):
n, bins, patches = plt.hist(array)
plt.show()
def analyze(file_path, word_set, ... | 24.18 | 101 | 0.539013 |
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import numpy
import matplotlib.pyplot as plt;
plt.rcdefaults()
from nltk.tokenize import sent_tokenize
def plot(array):
n, bins, patches = plt.hist(array)
plt.show()
def analyze(file_path, word_set, line_set):
word_length_array = []
senten... | true | true |
1c21e62ae978a09bd70079cdb9e0875454d3fd4f | 13,501 | py | Python | src/twisted/internet/error.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | 2 | 2021-03-27T20:11:56.000Z | 2021-05-04T19:34:44.000Z | src/twisted/internet/error.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | src/twisted/internet/error.py | ndg63276/twisted | f672a20395e8beece6350631a70514f06c391bae | [
"Unlicense",
"MIT"
] | 2 | 2021-05-29T21:12:22.000Z | 2021-05-30T04:56:50.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Exceptions and errors for use in twisted.internet modules.
"""
import socket
from twisted.python import deprecate
from incremental import Version
class BindError(Exception):
__doc__ = MESSAGE = "An error occurred binding to an interfa... | 26.472549 | 98 | 0.64099 |
import socket
from twisted.python import deprecate
from incremental import Version
class BindError(Exception):
__doc__ = MESSAGE = "An error occurred binding to an interface"
def __str__(self) -> str:
s = self.MESSAGE
if self.args:
s = "{}: {}".format(s, " ".join(self.args))... | true | true |
1c21e6387bf4406945a84cca5fc8f3d8992037a2 | 3,517 | py | Python | parser/fase2/team25/optimization/instruccion/optimized/assignment.py | Yosoyfr/tytus | 0df7e656835a93458462e476f7ab858a33baa2e0 | [
"MIT"
] | null | null | null | parser/fase2/team25/optimization/instruccion/optimized/assignment.py | Yosoyfr/tytus | 0df7e656835a93458462e476f7ab858a33baa2e0 | [
"MIT"
] | null | null | null | parser/fase2/team25/optimization/instruccion/optimized/assignment.py | Yosoyfr/tytus | 0df7e656835a93458462e476f7ab858a33baa2e0 | [
"MIT"
] | 4 | 2020-12-19T17:12:13.000Z | 2021-01-07T20:29:53.000Z | from enum import Enum
import optimization.abstract.optimize as opt
class OptAssignment(opt.OptimizedInstruction):
"""
Asignacion optimizada
"""
def __init__(self,type_,id,assign,row) -> None:
super().__init__(row)
self.type = type_
self.id = id
self.assign = assign
... | 39.516854 | 116 | 0.448962 | from enum import Enum
import optimization.abstract.optimize as opt
class OptAssignment(opt.OptimizedInstruction):
def __init__(self,type_,id,assign,row) -> None:
super().__init__(row)
self.type = type_
self.id = id
self.assign = assign
def __str__(self) -> str:
if self... | true | true |
1c21e6da210d164ef763dddca933b475067e5436 | 4,049 | py | Python | app.py | Mrutyu-1/malaria-liver-detection | 23506faff252ee34c1d0acc4163ebf6b200ce2bf | [
"MIT"
] | null | null | null | app.py | Mrutyu-1/malaria-liver-detection | 23506faff252ee34c1d0acc4163ebf6b200ce2bf | [
"MIT"
] | null | null | null | app.py | Mrutyu-1/malaria-liver-detection | 23506faff252ee34c1d0acc4163ebf6b200ce2bf | [
"MIT"
] | null | null | null | #Important Modules
from flask import Flask,render_template, url_for ,flash , redirect
#from forms import RegistrationForm, LoginForm
#from sklearn.externals import joblib
import joblib
from flask import request
import numpy as np
import tensorflow
#from keras.layers import Conv2D, MaxPooling2D, Dense, Dropout, Input, F... | 26.122581 | 119 | 0.698938 |
from flask import Flask,render_template, url_for ,flash , redirect
import joblib
from flask import request
import numpy as np
import tensorflow
import os
from flask import send_from_directory
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
import tensorflow ... | true | true |
1c21e85e73eee495a2ac65d807590e9e05d38b8c | 15,580 | py | Python | google/cloud/aiplatform_v1/types/endpoint.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/endpoint.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/types/endpoint.py | TheMichaelHu/python-aiplatform | e03f373a7e44c354eda88875a41c771f6d7e3ce1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.183771 | 119 | 0.644288 |
import proto
from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec
from google.cloud.aiplatform_v1.types import explanation
from google.cloud.aiplatform_v1.types import io
from google.cloud.aiplatform_v1.types import machine_resources
from google.protobuf import timestamp... | true | true |
1c21e8d549cd0fa77bdad479fcbb97e4b742cfc3 | 597 | py | Python | tests/beta_tests/test_number_number_wait_letter.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/beta_tests/test_number_number_wait_letter.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/beta_tests/test_number_number_wait_letter.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.beta.number_number_wait_letter import do_math
class DoMathTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(do_math("24z6 1x23 y369 89a 900b"), 1299)
def test_equal_2(self):
self.assertEqual(do_math("24z6 1z23 y369 89z 900b"), 1414)
def tes... | 28.428571 | 72 | 0.696817 | import unittest
from katas.beta.number_number_wait_letter import do_math
class DoMathTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(do_math("24z6 1x23 y369 89a 900b"), 1299)
def test_equal_2(self):
self.assertEqual(do_math("24z6 1z23 y369 89z 900b"), 1414)
def tes... | true | true |
1c21e9029ddfe12b962d326f626cfae18c786232 | 380 | py | Python | src/python/main.py | c1m50c/greyscale-image | 84d93f7fe73b26410e16cbd433fcc420fa439768 | [
"MIT"
] | null | null | null | src/python/main.py | c1m50c/greyscale-image | 84d93f7fe73b26410e16cbd433fcc420fa439768 | [
"MIT"
] | null | null | null | src/python/main.py | c1m50c/greyscale-image | 84d93f7fe73b26410e16cbd433fcc420fa439768 | [
"MIT"
] | null | null | null | from typing import List
import cv2
import sys
def main(args: List[str]):
if len(args) == 0:
raise ValueError("Missing 'FilePath' Argument.")
image_path: str = args.pop(0)
image = cv2.imread(image_path)
gs_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imwrite("output.jpg", g... | 21.111111 | 56 | 0.65 | from typing import List
import cv2
import sys
def main(args: List[str]):
if len(args) == 0:
raise ValueError("Missing 'FilePath' Argument.")
image_path: str = args.pop(0)
image = cv2.imread(image_path)
gs_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.imwrite("output.jpg", g... | true | true |
1c21ea4c61b006f9c52d5882f8d540209618a508 | 8,207 | py | Python | tests/models/validators/v3_0_0/jsd_f1b8eaf23e795f1a8525eb5905187aa9.py | oianson/ciscoisesdk | c8fe9d80416048dd0ff2241209c4f78ab78c1a4a | [
"MIT"
] | null | null | null | tests/models/validators/v3_0_0/jsd_f1b8eaf23e795f1a8525eb5905187aa9.py | oianson/ciscoisesdk | c8fe9d80416048dd0ff2241209c4f78ab78c1a4a | [
"MIT"
] | null | null | null | tests/models/validators/v3_0_0/jsd_f1b8eaf23e795f1a8525eb5905187aa9.py | oianson/ciscoisesdk | c8fe9d80416048dd0ff2241209c4f78ab78c1a4a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Identity Services Engine getAllDeviceAdminConditionsForAuthenticationRule data model.
Copyright (c) 2021 Cisco and/or its affiliates.
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... | 30.853383 | 88 | 0.404167 |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
import fastjsonschema
import json
from ciscoisesdk.exceptions import MalformedRequest
from builtins import *
class JSONSchemaValidatorF1B8Eaf23E795F1A8525Eb5905187Aa9(object):
def __init__(self):
s... | true | true |
1c21eab71b9086f614a542baa79d428a7113bfdc | 10,092 | py | Python | myems-api/reports/meterrealtime.py | hyh123a/myems | 669ab8554995a622da595384698d670f9cee61f8 | [
"MIT"
] | 2 | 2021-02-19T10:22:36.000Z | 2021-02-19T10:23:22.000Z | myems-api/reports/meterrealtime.py | hyh123a/myems | 669ab8554995a622da595384698d670f9cee61f8 | [
"MIT"
] | null | null | null | myems-api/reports/meterrealtime.py | hyh123a/myems | 669ab8554995a622da595384698d670f9cee61f8 | [
"MIT"
] | 1 | 2022-01-29T14:18:47.000Z | 2022-01-29T14:18:47.000Z | import falcon
import simplejson as json
import mysql.connector
import config
from datetime import datetime, timedelta, timezone
class Reporting:
@staticmethod
def __init__():
pass
@staticmethod
def on_options(req, resp):
resp.status = falcon.HTTP_200
#############################... | 48.990291 | 120 | 0.461653 | import falcon
import simplejson as json
import mysql.connector
import config
from datetime import datetime, timedelta, timezone
class Reporting:
@staticmethod
def __init__():
pass
@staticmethod
def on_options(req, resp):
resp.status = falcon.HTTP_200
| true | true |
1c21eba202a7c87dd47a97d40959e4c37613ce0d | 2,871 | py | Python | timepiece/manager/migrations/0001_initial.py | Engimusing/engimusing-mrp-system | 89b35e63d7045ca1686eb21f17c7f1f5855e1844 | [
"MIT"
] | null | null | null | timepiece/manager/migrations/0001_initial.py | Engimusing/engimusing-mrp-system | 89b35e63d7045ca1686eb21f17c7f1f5855e1844 | [
"MIT"
] | null | null | null | timepiece/manager/migrations/0001_initial.py | Engimusing/engimusing-mrp-system | 89b35e63d7045ca1686eb21f17c7f1f5855e1844 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2021-07-06 17:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | 42.850746 | 156 | 0.581331 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
1c21ebbbe6347e9574842e8729308e586414e284 | 660 | py | Python | bfs.py | NekoGaHoshiyi/Python_Advance | 3e52861b6988a5b88dd19a4647e5b92bd247a256 | [
"MIT"
] | 1 | 2021-05-09T15:14:20.000Z | 2021-05-09T15:14:20.000Z | bfs.py | NekoGaHoshiyi/Python_Advance | 3e52861b6988a5b88dd19a4647e5b92bd247a256 | [
"MIT"
] | null | null | null | bfs.py | NekoGaHoshiyi/Python_Advance | 3e52861b6988a5b88dd19a4647e5b92bd247a256 | [
"MIT"
] | null | null | null | import queue
def bfs(adj, start):
visited = set()
q = queue.Queue()
q.put(start)
while not q.empty():
u = q.get()
print(u)
for v in adj.get(u, []):
if v not in visited:
visited.add(v)
q.put(v)
def dfs(graph, start):
visited = []
... | 20.625 | 46 | 0.456061 | import queue
def bfs(adj, start):
visited = set()
q = queue.Queue()
q.put(start)
while not q.empty():
u = q.get()
print(u)
for v in adj.get(u, []):
if v not in visited:
visited.add(v)
q.put(v)
def dfs(graph, start):
visited = []
... | true | true |
1c21ec24d6757863db07da40d7d38faca3c306aa | 4,575 | py | Python | cogs/Stats.py | jess-sys/TwentyTwo | cb7a54499d82b9ee33935a0faf0ee995003d44c6 | [
"MIT"
] | 6 | 2017-08-11T16:45:59.000Z | 2018-08-24T23:02:59.000Z | cogs/Stats.py | jess-sys/TwentyTwo | cb7a54499d82b9ee33935a0faf0ee995003d44c6 | [
"MIT"
] | 1 | 2018-08-29T11:36:24.000Z | 2018-08-29T11:36:24.000Z | cogs/Stats.py | jess-sys/TwentyTwo | cb7a54499d82b9ee33935a0faf0ee995003d44c6 | [
"MIT"
] | 2 | 2017-09-25T12:15:29.000Z | 2017-09-27T23:34:14.000Z | import discord
from discord.ext import commands
def format_keyvalues(dictionary):
r = ''
width = len(max(dictionary.keys(), key=len))
f = '{0:>%d}: {1}\n' % (width)
for key, value in dictionary.items():
if isinstance(value, list):
r += f.format(key, '{}/{}'.format(value[0], ... | 37.195122 | 91 | 0.514317 | import discord
from discord.ext import commands
def format_keyvalues(dictionary):
r = ''
width = len(max(dictionary.keys(), key=len))
f = '{0:>%d}: {1}\n' % (width)
for key, value in dictionary.items():
if isinstance(value, list):
r += f.format(key, '{}/{}'.format(value[0], ... | true | true |
1c21ec3add365ead5f23c4a7d7c1d410f3a33499 | 1,844 | py | Python | Memory Scripts/helper.py | n3urovirtual/EyeTracking_Experiment_Children | 56c08a1202a686ac8f05d3c4e53766537895fe4f | [
"MIT"
] | 1 | 2022-02-11T19:22:07.000Z | 2022-02-11T19:22:07.000Z | Memory Scripts/helper.py | n3urovirtual/EyeTracking_Experiment_Children | 56c08a1202a686ac8f05d3c4e53766537895fe4f | [
"MIT"
] | null | null | null | Memory Scripts/helper.py | n3urovirtual/EyeTracking_Experiment_Children | 56c08a1202a686ac8f05d3c4e53766537895fe4f | [
"MIT"
] | null | null | null | screen_resX = 1920
screen_resY = 1080
img_id = [
1,
2,
7,
12,
13,
19,
25,
41,
42,
48,
49,
51,
54,
55,
59,
61,
64,
74,
76,
77,
84,
88,
91,
94,
100,
101,
112,
113,
6,
10,
17,
21,
23,
2... | 13.266187 | 71 | 0.557484 | screen_resX = 1920
screen_resY = 1080
img_id = [
1,
2,
7,
12,
13,
19,
25,
41,
42,
48,
49,
51,
54,
55,
59,
61,
64,
74,
76,
77,
84,
88,
91,
94,
100,
101,
112,
113,
6,
10,
17,
21,
23,
2... | true | true |
1c21ed4a2f9708d5647d14edaa076ef3452cc94f | 1,845 | py | Python | phillydata/availableproperties/tests.py | ebrelsford/django-phillydata | 444a3ff9d436cd276530534642dd092402278ba5 | [
"BSD-3-Clause"
] | null | null | null | phillydata/availableproperties/tests.py | ebrelsford/django-phillydata | 444a3ff9d436cd276530534642dd092402278ba5 | [
"BSD-3-Clause"
] | null | null | null | phillydata/availableproperties/tests.py | ebrelsford/django-phillydata | 444a3ff9d436cd276530534642dd092402278ba5 | [
"BSD-3-Clause"
] | 1 | 2020-01-23T04:59:36.000Z | 2020-01-23T04:59:36.000Z | from django.test import TestCase
import adapter
from .models import AvailableProperty
class AdapterTest(TestCase):
available_property = {
u'geometry': {u'y': 39.9664, u'x': -75.2079},
u'attributes': {
u'ASSET_ID': 14208,
u'OBJECTID': 35851,
u'DESCR': None,
... | 31.810345 | 75 | 0.595664 | from django.test import TestCase
import adapter
from .models import AvailableProperty
class AdapterTest(TestCase):
available_property = {
u'geometry': {u'y': 39.9664, u'x': -75.2079},
u'attributes': {
u'ASSET_ID': 14208,
u'OBJECTID': 35851,
u'DESCR': None,
... | true | true |
1c21eeb3f2794d9368ab1d83ddbfebafd5a1038d | 644 | py | Python | software/misc/get_gene_background.py | Searchlight2/Searchlight2 | 87c85975be49c503f79063d72d321da21a6c6341 | [
"MIT"
] | 17 | 2018-12-11T13:36:12.000Z | 2022-03-31T06:27:59.000Z | software/misc/get_gene_background.py | Searchlight2/Searchlight2 | 87c85975be49c503f79063d72d321da21a6c6341 | [
"MIT"
] | 1 | 2019-11-26T11:00:57.000Z | 2019-11-26T11:01:12.000Z | software/misc/get_gene_background.py | Searchlight2/Searchlight2 | 87c85975be49c503f79063d72d321da21a6c6341 | [
"MIT"
] | 7 | 2020-05-21T16:35:41.000Z | 2022-03-31T06:28:01.000Z |
def get_gene_background(global_variables,gene_dictionary):
values_list = []
# adds the background information
if global_variables["GENE_SYMBOL_FLAG"]:
values_list.append(gene_dictionary["SYMBOL"])
if global_variables["GENE_BIOTYPE_FLAG"]:
values_list.append(gene_dictionary["BIOTYPE"])... | 33.894737 | 58 | 0.734472 |
def get_gene_background(global_variables,gene_dictionary):
values_list = []
if global_variables["GENE_SYMBOL_FLAG"]:
values_list.append(gene_dictionary["SYMBOL"])
if global_variables["GENE_BIOTYPE_FLAG"]:
values_list.append(gene_dictionary["BIOTYPE"])
if global_variables["GENE_CH... | true | true |
1c21eef7bd56fcf4645993d49f7de4ffb48857a4 | 1,968 | py | Python | annotathon/utils/customobjs.py | gmagannaDevelop/Annotathon | 8b25b3697dde0095615fc81f0a6bd697d2365036 | [
"EFL-2.0"
] | 2 | 2020-11-09T16:18:04.000Z | 2020-11-11T06:37:26.000Z | annotathon/utils/customobjs.py | gmagannaDevelop/Annotathon | 8b25b3697dde0095615fc81f0a6bd697d2365036 | [
"EFL-2.0"
] | null | null | null | annotathon/utils/customobjs.py | gmagannaDevelop/Annotathon | 8b25b3697dde0095615fc81f0a6bd697d2365036 | [
"EFL-2.0"
] | null | null | null | from pathlib import (
Path as _Path_,
PosixPath as _PosixPath_,
WindowsPath as _WindowsPath_,
)
import os
class Path(_Path_):
"""
Basically a wrapper for pathlib.Path,
created to modify pathlib.Path.glob's behaviour :
I don't like generators for practical purposes.
I added a method ... | 21.626374 | 84 | 0.611789 | from pathlib import (
Path as _Path_,
PosixPath as _PosixPath_,
WindowsPath as _WindowsPath_,
)
import os
class Path(_Path_):
def __new__(cls, *args, **kvps):
return super().__new__(
WindowsPath if os.name == "nt" else PosixPath, *args, **kvps
)
def lglob(self, expr: ... | true | true |
1c21ef03c33a0a8cd968f32824ccfcc194f826a4 | 4,023 | py | Python | pychron/social/twitter/tasks/plugin.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/social/twitter/tasks/plugin.py | ael-noblegas/pychron | 6ebbbb1f66a614972b62b7a9be4c784ae61b5d62 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/social/twitter/tasks/plugin.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2015 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... | 40.23 | 109 | 0.605767 |
from __future__ import absolute_import
from traits.api import List, Instance
from pychron.envisage.tasks.base_task_plugin import BaseTaskPlugin
from pychron.experiment.events import ExperimentEventAddition, START_QUEUE, END_QUEUE, START_RUN, END_RUN
from pychron.social.twitter.client import TwitterCli... | true | true |
1c21ef1a36a2833f73c2710f878111a55980adfb | 3,611 | py | Python | flask/lib/python3.6/site-packages/openpyxl/styles/fills.py | JOFLIX/grapevines | 34576e01184570d79cc140b42ffb71d322132da6 | [
"MIT",
"Unlicense"
] | 8 | 2016-05-27T12:13:16.000Z | 2019-08-05T13:49:11.000Z | flask/lib/python3.6/site-packages/openpyxl/styles/fills.py | JOFLIX/grapevines | 34576e01184570d79cc140b42ffb71d322132da6 | [
"MIT",
"Unlicense"
] | 3 | 2019-07-29T09:47:34.000Z | 2019-07-29T09:47:35.000Z | flask/lib/python3.6/site-packages/openpyxl/styles/fills.py | JOFLIX/grapevines | 34576e01184570d79cc140b42ffb71d322132da6 | [
"MIT",
"Unlicense"
] | 1 | 2021-07-21T00:07:30.000Z | 2021-07-21T00:07:30.000Z | from __future__ import absolute_import
# Copyright (c) 2010-2014 openpyxl
from openpyxl.descriptors import Float, Set, Sequence, Alias, NoneSet
from openpyxl.compat import safe_string
from .colors import ColorDescriptor, Color
from .hashable import HashableObject
FILL_NONE = 'none'
FILL_SOLID = 'solid'
FILL_PATTERN... | 31.4 | 86 | 0.677098 | from __future__ import absolute_import
from openpyxl.descriptors import Float, Set, Sequence, Alias, NoneSet
from openpyxl.compat import safe_string
from .colors import ColorDescriptor, Color
from .hashable import HashableObject
FILL_NONE = 'none'
FILL_SOLID = 'solid'
FILL_PATTERN_DARKDOWN = 'darkDown'
FILL_PATTER... | true | true |
1c21ef845d51800e1ae96ae54cbb392f5d89cb88 | 2,953 | py | Python | app/request.py | RonnyLincoln/news | 86ed7f3804d171a47d148db55ca10da4f78bab97 | [
"MIT"
] | null | null | null | app/request.py | RonnyLincoln/news | 86ed7f3804d171a47d148db55ca10da4f78bab97 | [
"MIT"
] | null | null | null | app/request.py | RonnyLincoln/news | 86ed7f3804d171a47d148db55ca10da4f78bab97 | [
"MIT"
] | null | null | null | from .models import Sources, Articles
import urllib.request, json
api_key = None
sources_url = None
articles_url = None
topheadlines_url = None
everything_url = None
everything_search_url = None
def configure_request(app):
global api_key, base_url, articles_url
api_key = app.config['NEWS_API_KEY']
base_u... | 27.858491 | 96 | 0.695564 | from .models import Sources, Articles
import urllib.request, json
api_key = None
sources_url = None
articles_url = None
topheadlines_url = None
everything_url = None
everything_search_url = None
def configure_request(app):
global api_key, base_url, articles_url
api_key = app.config['NEWS_API_KEY']
base_u... | true | true |
1c21efa807474bd88349469e90fbaf993fc9cdc5 | 149 | py | Python | allegation/tests/utils/outcome_filter.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 16 | 2016-05-20T09:03:32.000Z | 2020-09-13T14:23:06.000Z | allegation/tests/utils/outcome_filter.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 2 | 2016-05-24T01:44:14.000Z | 2016-06-17T22:19:45.000Z | allegation/tests/utils/outcome_filter.py | invinst/CPDB | c2d8ae8888b13d956cc1068742f18d45736d4121 | [
"Apache-2.0"
] | 2 | 2016-10-10T16:14:19.000Z | 2020-10-26T00:17:02.000Z | from allegation.services.outcome_analytics import FILTERS
def number_of_all_created_complaints():
return sum(len(x) for x in FILTERS.values())
| 24.833333 | 57 | 0.798658 | from allegation.services.outcome_analytics import FILTERS
def number_of_all_created_complaints():
return sum(len(x) for x in FILTERS.values())
| true | true |
1c21f00e6c29d0204b1ea4f993a2e34df4b0a9b8 | 11,867 | py | Python | python/src/iceberg/expressions/literals.py | danielcweeks/incubator-iceberg | b37204ae467b710ecf0ace9b1c2b49bcd256ab9b | [
"Apache-2.0"
] | null | null | null | python/src/iceberg/expressions/literals.py | danielcweeks/incubator-iceberg | b37204ae467b710ecf0ace9b1c2b49bcd256ab9b | [
"Apache-2.0"
] | null | null | null | python/src/iceberg/expressions/literals.py | danielcweeks/incubator-iceberg | b37204ae467b710ecf0ace9b1c2b49bcd256ab9b | [
"Apache-2.0"
] | null | null | null | # 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 un... | 26.848416 | 120 | 0.659307 |
import struct
import sys
from decimal import ROUND_HALF_UP, Decimal
from functools import singledispatch
from typing import Optional, Union
from uuid import UUID
from iceberg.utils.datetime import (
date_to_days,
micros_to_days,
time_to_micros,
timestamp_to_micros,
timestamptz... | true | true |
1c21f02b1b0c7af47de10367da2a4e97b40312ab | 24,347 | py | Python | optlang/tests/test_glpk_interface.py | braceal/optlang | 177db7eec84dbff374964fe5314ee82642b12a15 | [
"Apache-2.0"
] | 1 | 2021-09-08T11:20:46.000Z | 2021-09-08T11:20:46.000Z | optlang/tests/test_glpk_interface.py | braceal/optlang | 177db7eec84dbff374964fe5314ee82642b12a15 | [
"Apache-2.0"
] | null | null | null | optlang/tests/test_glpk_interface.py | braceal/optlang | 177db7eec84dbff374964fe5314ee82642b12a15 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Novo Nordisk Foundation Center for Biosustainability, DTU.
# See LICENSE for details.
import copy
import os
import pickle
import random
import unittest
import nose
import optlang
from optlang import glpk_interface
from optlang.tests import abstract_test_cases
from optlang.util import glpk_read_cpl... | 53.984479 | 146 | 0.632111 |
import copy
import os
import pickle
import random
import unittest
import nose
import optlang
from optlang import glpk_interface
from optlang.tests import abstract_test_cases
from optlang.util import glpk_read_cplex
from swiglpk import glp_get_num_rows, glp_get_col_name, glp_get_num_cols, glp_get_prob_name, glp_get_r... | true | true |
1c21f04f62c6f627092f5233d9eaa6f26e9142c7 | 488 | py | Python | src/the_impossible/live/migrations/userupload/migrations/0008_auto_20200516_1639.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | null | null | null | src/the_impossible/live/migrations/userupload/migrations/0008_auto_20200516_1639.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | 2 | 2020-04-15T03:57:42.000Z | 2020-06-06T01:43:34.000Z | src/userupload/migrations/0008_auto_20200516_1639.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2020-05-16 04:39
from django.db import migrations, models
import userupload.models
class Migration(migrations.Migration):
dependencies = [
('userupload', '0007_delete_link'),
]
operations = [
migrations.AlterField(
model_name='file',
... | 24.4 | 135 | 0.657787 |
from django.db import migrations, models
import userupload.models
class Migration(migrations.Migration):
dependencies = [
('userupload', '0007_delete_link'),
]
operations = [
migrations.AlterField(
model_name='file',
name='file',
field=models.FileFie... | true | true |
1c21f19fd2a1dae8d096262a5c0cc7722bee7e01 | 1,561 | py | Python | cosme/v1/views/external_view.py | contactr2m/cosme | d89540eaabed11220b0e859a7a0cbc5541249624 | [
"MIT"
] | null | null | null | cosme/v1/views/external_view.py | contactr2m/cosme | d89540eaabed11220b0e859a7a0cbc5541249624 | [
"MIT"
] | 3 | 2021-03-31T18:49:32.000Z | 2021-12-13T19:51:36.000Z | cosme/v1/views/external_view.py | contactr2m/cosme | d89540eaabed11220b0e859a7a0cbc5541249624 | [
"MIT"
] | null | null | null | from django.http import Http404
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import TemplateView
from django.views.generic.edit import FormMixin
from cosme.v1.forms import ExternalURLForm
clas... | 28.381818 | 79 | 0.680974 | from django.http import Http404
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import TemplateView
from django.views.generic.edit import FormMixin
from cosme.v1.forms import ExternalURLForm
clas... | true | true |
1c21f2a31ac1adbb490d44138f4ba256200b13f9 | 513 | py | Python | FFTTest/WaveGen.py | AaronLieberman/ArduinoTinkering | ff6bb7de75026a5b38c651f604d379d662b58c93 | [
"MIT"
] | 1 | 2019-01-09T03:50:20.000Z | 2019-01-09T03:50:20.000Z | FFTTest/WaveGen.py | AaronLieberman/ArduinoTinkering | ff6bb7de75026a5b38c651f604d379d662b58c93 | [
"MIT"
] | null | null | null | FFTTest/WaveGen.py | AaronLieberman/ArduinoTinkering | ff6bb7de75026a5b38c651f604d379d662b58c93 | [
"MIT"
] | null | null | null | import math
samplingRate = 2000
lengthInSeconds = 1
frequency = 440 # middle A (iirc)
samples = list()
for j in range(4):
pointScale = samplingRate / frequency / (j + 1) * 2 * math.pi
for i in range(samplingRate * lengthInSeconds):
v = int((math.sin(i / pointScale) + 1) * 512)
samples.append(v... | 28.5 | 65 | 0.647173 | import math
samplingRate = 2000
lengthInSeconds = 1
frequency = 440
samples = list()
for j in range(4):
pointScale = samplingRate / frequency / (j + 1) * 2 * math.pi
for i in range(samplingRate * lengthInSeconds):
v = int((math.sin(i / pointScale) + 1) * 512)
samples.append(v & 255)
s... | true | true |
1c21f3dc295a2cab371dedaec5b803ff6e2d7e59 | 218 | py | Python | Contest_Output/Test_Case_Implementations/Part1/source/automated_test/Test1/GDFtoDAT.py | NREL/OpenWARP | ca49c4cbde17e0cead69bd9e55a81d5c0fafe4df | [
"Apache-2.0"
] | 22 | 2015-06-22T07:35:04.000Z | 2021-07-23T05:10:09.000Z | Contest_Output/Test_Case_Implementations/Part1/source/automated_test/Test1/GDFtoDAT.py | NREL/OpenWARP | ca49c4cbde17e0cead69bd9e55a81d5c0fafe4df | [
"Apache-2.0"
] | 9 | 2015-07-30T20:01:35.000Z | 2020-08-28T17:29:18.000Z | Contest_Output/Test_Case_Implementations/Part1/source/automated_test/Test1/GDFtoDAT.py | NREL/OpenWARP | ca49c4cbde17e0cead69bd9e55a81d5c0fafe4df | [
"Apache-2.0"
] | 13 | 2016-04-01T07:45:27.000Z | 2021-04-06T08:33:33.000Z | # Import the bemio.mesh_utilities module
import mesh
import numpy as np
import sys
gdfFile = sys.argv[1]
# Read WAMIT mesh
buoy = mesh.read(file_name=gdfFile)
# Save to a NEMOH mesh
buoy.write(mesh_format='NEMOH')
| 16.769231 | 40 | 0.756881 |
import mesh
import numpy as np
import sys
gdfFile = sys.argv[1]
buoy = mesh.read(file_name=gdfFile)
buoy.write(mesh_format='NEMOH')
| true | true |
1c21f70ecc98e6869def6d4bad42701bb1e5c85a | 17,314 | py | Python | openpathsampling/tests/test_spring_shooting.py | bolhuis/openpathsampling | 4a12af0ee1143cdbc272b10a8c7cbea735566ce1 | [
"MIT"
] | null | null | null | openpathsampling/tests/test_spring_shooting.py | bolhuis/openpathsampling | 4a12af0ee1143cdbc272b10a8c7cbea735566ce1 | [
"MIT"
] | 1 | 2021-02-01T21:42:21.000Z | 2021-02-01T21:42:21.000Z | openpathsampling/tests/test_spring_shooting.py | hejung/openpathsampling | e8b091c92916561954542d40d17d7241b203d1ad | [
"MIT"
] | null | null | null | import pytest
import openpathsampling as paths
from openpathsampling import MoveChange, Details
from openpathsampling.high_level.move_scheme import MoveScheme
from openpathsampling.tests.test_movestrategy import MoveStrategyTestSetup
from openpathsampling.pathmover import SampleNaNError, SampleMaxLengthError
from openp... | 38.820628 | 79 | 0.595934 | import pytest
import openpathsampling as paths
from openpathsampling import MoveChange, Details
from openpathsampling.high_level.move_scheme import MoveScheme
from openpathsampling.tests.test_movestrategy import MoveStrategyTestSetup
from openpathsampling.pathmover import SampleNaNError, SampleMaxLengthError
from openp... | true | true |
1c21f859c3dbd7552b460756de7c55854fa5fdd1 | 11,182 | py | Python | py/selenium/webdriver/support/color.py | pulkitsinghal/selenium | 96895ca96dbf4f213ea54e3856f847c008f623c3 | [
"Apache-2.0"
] | null | null | null | py/selenium/webdriver/support/color.py | pulkitsinghal/selenium | 96895ca96dbf4f213ea54e3856f847c008f623c3 | [
"Apache-2.0"
] | null | null | null | py/selenium/webdriver/support/color.py | pulkitsinghal/selenium | 96895ca96dbf4f213ea54e3856f847c008f623c3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2011 Software Freedom Conservancy.
#
# 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 app... | 36.187702 | 146 | 0.555178 |
RGB_PATTERN = r"^\s*rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)\s*$"
RGB_PCT_PATTERN = r"^\s*rgb\(\s*(\d{1,3}|\d{1,2}\.\d+)%\s*,\s*(\d{1,3}|\d{1,2}\.\d+)%\s*,\s*(\d{1,3}|\d{1,2}\.\d+)%\s*\)\s*$"
RGBA_PATTERN = r"^\s*rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0\.\d+)\s*\)\s*... | true | true |
1c21f87ba1c5b53572a38f40b5689a16e28fe0e9 | 552 | py | Python | manage.py | Hamuko/daiseihai | aed9deddf3ad763d812208c9f43b62be38f72e78 | [
"Apache-2.0"
] | null | null | null | manage.py | Hamuko/daiseihai | aed9deddf3ad763d812208c9f43b62be38f72e78 | [
"Apache-2.0"
] | 2 | 2021-03-09T02:09:43.000Z | 2021-09-01T02:52:03.000Z | manage.py | Hamuko/daiseihai | aed9deddf3ad763d812208c9f43b62be38f72e78 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "daiseihai.settings.production")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import... | 34.5 | 84 | 0.692029 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "daiseihai.settings.production")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure... | true | true |
1c21f8ad7992b1fb4affbfaf5f225d364f988db4 | 2,412 | py | Python | reader/fnoData/idxOptDataWrapper.py | sifarone/gce_k8s_deployment | f596e17b9d0263ae24c61ebba9925af4719b4306 | [
"MIT"
] | null | null | null | reader/fnoData/idxOptDataWrapper.py | sifarone/gce_k8s_deployment | f596e17b9d0263ae24c61ebba9925af4719b4306 | [
"MIT"
] | null | null | null | reader/fnoData/idxOptDataWrapper.py | sifarone/gce_k8s_deployment | f596e17b9d0263ae24c61ebba9925af4719b4306 | [
"MIT"
] | 1 | 2021-01-24T17:07:37.000Z | 2021-01-24T17:07:37.000Z | import datetime
import copy
from . import fnoUtils as utils
from . import dailyDataUtils
from . import idxOptDailyDataWrapper
'''
1. This class is a wrapper over the stock option data (each document) fetched from Database.
2. It Adds few utility functions over this data to be used in the application
3. It indexes the... | 34.956522 | 138 | 0.662106 | import datetime
import copy
from . import fnoUtils as utils
from . import dailyDataUtils
from . import idxOptDailyDataWrapper
class IdxOptDataWrapper:
def __init__(self, idxOptionData):
self.symbol = idxOptionData['symbol']
self.expiryDate = idxOptionData['expiryDate']
self.s... | true | true |
1c21fa3c04d8912b618894d0b92cb6778b7ebe5d | 2,472 | py | Python | examples/pytorch/resnet18/test.py | CristiFati/rknn-toolkit | a345d99be30c1ca84f56dd68a213c740450eeaa5 | [
"BSD-3-Clause"
] | 409 | 2019-05-10T05:18:02.000Z | 2022-03-30T05:55:33.000Z | examples/pytorch/resnet18/test.py | CristiFati/rknn-toolkit | a345d99be30c1ca84f56dd68a213c740450eeaa5 | [
"BSD-3-Clause"
] | 212 | 2019-06-10T09:05:49.000Z | 2022-03-30T08:45:40.000Z | examples/pytorch/resnet18/test.py | CristiFati/rknn-toolkit | a345d99be30c1ca84f56dd68a213c740450eeaa5 | [
"BSD-3-Clause"
] | 116 | 2019-05-17T00:44:35.000Z | 2022-03-21T08:36:26.000Z | import numpy as np
import cv2
from rknn.api import RKNN
import torchvision.models as models
import torch
def export_pytorch_model():
net = models.resnet18(pretrained=True)
net.eval()
trace_model = torch.jit.trace(net, torch.Tensor(1,3,224,224))
trace_model.save('./resnet18.pt')
def show_outputs(outp... | 24.475248 | 120 | 0.588997 | import numpy as np
import cv2
from rknn.api import RKNN
import torchvision.models as models
import torch
def export_pytorch_model():
net = models.resnet18(pretrained=True)
net.eval()
trace_model = torch.jit.trace(net, torch.Tensor(1,3,224,224))
trace_model.save('./resnet18.pt')
def show_outputs(outp... | true | true |
1c21fa6668367ced859376caf95e9d8451f6f5c6 | 10,603 | py | Python | cirq/protocols/apply_channel_protocol_test.py | exAClior/Cirq | 0701327bc66c988428f302dd1e4bed1eef1535a6 | [
"Apache-2.0"
] | 1 | 2020-10-15T19:02:39.000Z | 2020-10-15T19:02:39.000Z | cirq/protocols/apply_channel_protocol_test.py | rohitvuppala/Cirq | 0ff2894e053e4ce3bb1b54e9b9de1cc4345d10b3 | [
"Apache-2.0"
] | 5 | 2020-08-20T01:03:57.000Z | 2021-04-13T00:26:48.000Z | cirq/protocols/apply_channel_protocol_test.py | rohitvuppala/Cirq | 0ff2894e053e4ce3bb1b54e9b9de1cc4345d10b3 | [
"Apache-2.0"
] | 1 | 2021-12-30T21:50:00.000Z | 2021-12-30T21:50:00.000Z | # Copyright 2019 The Cirq Developers
#
# 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 agreed to in ... | 33.875399 | 100 | 0.620108 |
import numpy as np
import pytest
import cirq
def make_buffers(shape, dtype):
return (
np.empty(shape, dtype=dtype),
np.empty(shape, dtype=dtype),
np.empty(shape, dtype=dtype),
)
def apply_channel(val, rho, left_axes, right_axes, assert_result_is_out_buf=False):
out... | true | true |
1c21fc0dd4b4e7d6bced16b095da9f688d2f105f | 10,647 | py | Python | doc/source/conf.py | glotzerlab/freud-test | acbccc38bbcc984d84758048f1fdefc4252ce3d3 | [
"BSD-3-Clause"
] | null | null | null | doc/source/conf.py | glotzerlab/freud-test | acbccc38bbcc984d84758048f1fdefc4252ce3d3 | [
"BSD-3-Clause"
] | null | null | null | doc/source/conf.py | glotzerlab/freud-test | acbccc38bbcc984d84758048f1fdefc4252ce3d3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# freud documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 28 11:39:18 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | 32.361702 | 79 | 0.698601 |
import os
import sys
sys.path.insert(0, os.path.abspath("../../.."))
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.todo",
"sphinx.ext.intersphinx",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"nbsphinx",
... | true | true |
1c21fca51c805ccfc10a9cdfdfc7d4881d81191b | 7,821 | py | Python | python/dask_cudf/dask_cudf/accessors.py | Ahsantw/cudf | e099688d5ca7dd20104930485a829881a68c522a | [
"Apache-2.0"
] | 4,012 | 2018-10-29T00:11:19.000Z | 2022-03-31T19:20:19.000Z | python/dask_cudf/dask_cudf/accessors.py | Ahsantw/cudf | e099688d5ca7dd20104930485a829881a68c522a | [
"Apache-2.0"
] | 9,865 | 2018-10-29T12:52:07.000Z | 2022-03-31T23:09:21.000Z | python/dask_cudf/dask_cudf/accessors.py | Ahsantw/cudf | e099688d5ca7dd20104930485a829881a68c522a | [
"Apache-2.0"
] | 588 | 2018-10-29T05:52:44.000Z | 2022-03-28T06:13:09.000Z | # Copyright (c) 2021, NVIDIA CORPORATION.
class StructMethods:
def __init__(self, d_series):
self.d_series = d_series
def field(self, key):
"""
Extract children of the specified struct column
in the Series
Parameters
----------
key: int or str
... | 27.250871 | 79 | 0.454801 |
class StructMethods:
def __init__(self, d_series):
self.d_series = d_series
def field(self, key):
typ = self.d_series._meta.struct.field(key).dtype
return self.d_series.map_partitions(
lambda s: s.struct.field(key),
meta=self.d_series._meta._constructor([], d... | true | true |
1c21ffe6d382e9553cfd45517be27aeb8e8a1d87 | 16,751 | py | Python | nova/tests/unit/objects/test_block_device.py | zaina/nova | 181358c172d606b23c9cc14b58d677d911013c02 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/objects/test_block_device.py | zaina/nova | 181358c172d606b23c9cc14b58d677d911013c02 | [
"Apache-2.0"
] | 1 | 2019-01-02T01:30:35.000Z | 2019-01-02T01:38:02.000Z | nova/tests/unit/objects/test_block_device.py | zaina/nova | 181358c172d606b23c9cc14b58d677d911013c02 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Red Hat 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 ag... | 41.565757 | 78 | 0.621038 |
import mock
import six
from nova.cells import rpcapi as cells_rpcapi
from nova import context
from nova import db
from nova import exception
from nova import objects
from nova.objects import block_device as block_device_obj
from nova import test
from nova.tests.unit import fake_block_device
from nova.tes... | true | true |
1c2200459ac03f0f20cca5834fd9e03db7f26055 | 518 | py | Python | nomadgram/users/migrations/0007_auto_20180730_2013.py | juyoungpark718/juyoungram | 24182afb4d3076ba9a8614846368781883f255fa | [
"MIT"
] | null | null | null | nomadgram/users/migrations/0007_auto_20180730_2013.py | juyoungpark718/juyoungram | 24182afb4d3076ba9a8614846368781883f255fa | [
"MIT"
] | 12 | 2021-03-02T01:12:10.000Z | 2022-03-03T23:07:52.000Z | nomadgram/users/migrations/0007_auto_20180730_2013.py | juyoungpark718/juyoungram | 24182afb4d3076ba9a8614846368781883f255fa | [
"MIT"
] | null | null | null | # Generated by Django 2.0.7 on 2018-07-30 11:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20180730_1939'),
]
operations = [
migrations.AlterField(
model_name='user',
name='gender',
... | 30.470588 | 109 | 0.548263 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20180730_1939'),
]
operations = [
migrations.AlterField(
model_name='user',
name='gender',
field=models.CharField(choices=[('not-specif... | true | true |
1c2200d7848d7b477fcfcd3f8a81605b2664ae87 | 3,187 | py | Python | angry_scientists_lab/science_lab.py | ikazman/angry_scientists_lab | b1e59d35e2c5b37b7c939daedc3a06cf02353a6e | [
"MIT"
] | null | null | null | angry_scientists_lab/science_lab.py | ikazman/angry_scientists_lab | b1e59d35e2c5b37b7c939daedc3a06cf02353a6e | [
"MIT"
] | null | null | null | angry_scientists_lab/science_lab.py | ikazman/angry_scientists_lab | b1e59d35e2c5b37b7c939daedc3a06cf02353a6e | [
"MIT"
] | null | null | null | import random
import statistics
random.seed(42) # фикисируем случайные числа
class ScienceLab:
"""Класс для имитации работы лаборатории для разведения крыс:
https://en.wikipedia.org/wiki/Brown_rat."""
def __init__(self, goal=50000, rats_in_lab=20, generation_limit=500):
"""Исходные параметры дл... | 40.858974 | 78 | 0.644179 | import random
import statistics
random.seed(42)
class ScienceLab:
def __init__(self, goal=50000, rats_in_lab=20, generation_limit=500):
self.goal = goal
self.rats_in_lab = rats_in_lab
self.init_min_weight = 200
self.init_max_weight = 600
self.init_mode_weigth = 300
... | true | true |
1c22025a7b1cf7f684051f55cab9dc87a88f497c | 135 | py | Python | base/admin.py | FreeGodCode/store | 1ea1d6f0d6030fb58bce9a4e2d428342a0c3ad19 | [
"MIT"
] | null | null | null | base/admin.py | FreeGodCode/store | 1ea1d6f0d6030fb58bce9a4e2d428342a0c3ad19 | [
"MIT"
] | 1 | 2021-03-05T15:00:38.000Z | 2021-03-05T15:00:38.000Z | base/admin.py | FreeGodCode/store | 1ea1d6f0d6030fb58bce9a4e2d428342a0c3ad19 | [
"MIT"
] | null | null | null | from django.contrib import admin
# from base.models import UserProfile
# Register your models here.
# admin.site.register(UserProfile)
| 27 | 37 | 0.807407 | from django.contrib import admin
| true | true |
1c220483c78d997270742ad59b38c067e43c56b8 | 1,021 | py | Python | backend/backend/users/api/passwordless_urls.py | Greening-Digital/constellate | e7e6d9f555ae66908a6d076416ce0a3c5b2a6687 | [
"Apache-2.0"
] | 1 | 2020-11-23T22:48:19.000Z | 2020-11-23T22:48:19.000Z | backend/backend/users/api/passwordless_urls.py | Greening-Digital/constellate | e7e6d9f555ae66908a6d076416ce0a3c5b2a6687 | [
"Apache-2.0"
] | 47 | 2020-06-09T09:34:59.000Z | 2021-08-07T16:20:19.000Z | backend/backend/users/api/passwordless_urls.py | Greening-Digital/constellate | e7e6d9f555ae66908a6d076416ce0a3c5b2a6687 | [
"Apache-2.0"
] | 2 | 2020-09-16T08:42:16.000Z | 2020-10-27T20:27:28.000Z | from drfpasswordless.settings import api_settings
from django.urls import path
from drfpasswordless.views import (
ObtainAuthTokenFromCallbackToken,
VerifyAliasFromCallbackToken,
ObtainEmailVerificationCallbackToken,
ObtainEmailCallbackToken,
)
from .passwordless_views import (
ConstellateEmailCallb... | 28.361111 | 62 | 0.717924 | from drfpasswordless.settings import api_settings
from django.urls import path
from drfpasswordless.views import (
ObtainAuthTokenFromCallbackToken,
VerifyAliasFromCallbackToken,
ObtainEmailVerificationCallbackToken,
ObtainEmailCallbackToken,
)
from .passwordless_views import (
ConstellateEmailCallb... | true | true |
1c220487a5ecd6a0ace19bd41e7559a91f6d226c | 279 | py | Python | social_network/management/commands/configuresocialnetwork.py | diana-gv/django-social-network | 48bafca81f28874ceead59e263ce5b7e3853dbfb | [
"BSD-3-Clause"
] | 3 | 2015-01-13T05:45:04.000Z | 2020-01-10T19:05:35.000Z | social_network/management/commands/configuresocialnetwork.py | diana-gv/django-social-network | 48bafca81f28874ceead59e263ce5b7e3853dbfb | [
"BSD-3-Clause"
] | null | null | null | social_network/management/commands/configuresocialnetwork.py | diana-gv/django-social-network | 48bafca81f28874ceead59e263ce5b7e3853dbfb | [
"BSD-3-Clause"
] | 6 | 2015-01-13T04:40:53.000Z | 2021-08-13T01:07:40.000Z | # coding=utf-8
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle_noargs(self, **options):
from ...management import configure_notifications, create_edge_types
configure_notifications()
create_edge_types() | 31 | 76 | 0.749104 |
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle_noargs(self, **options):
from ...management import configure_notifications, create_edge_types
configure_notifications()
create_edge_types() | true | true |
1c2204d15680589e1a864c6ef9236eb032c614f3 | 478 | py | Python | env/lib/python3.8/site-packages/plotly/validators/bar/marker/colorbar/_tickvals.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/bar/marker/colorbar/_tickvals.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/bar/marker/colorbar/_tickvals.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="bar.marker.colorbar", **kwargs
):
super(TickvalsValidator, self).__init__(
plotly_name=plotly_name,
par... | 31.866667 | 81 | 0.646444 | import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="bar.marker.colorbar", **kwargs
):
super(TickvalsValidator, self).__init__(
plotly_name=plotly_name,
par... | true | true |
1c220727a9f8b271612dd1ac5fce4d67c080befc | 874 | py | Python | migrations/versions/e772522154a1_add_2_file_errors.py | itsjef/alembic-enum-playground | a289089275bb9170f9598f72b2c1523cd0764409 | [
"Apache-2.0"
] | null | null | null | migrations/versions/e772522154a1_add_2_file_errors.py | itsjef/alembic-enum-playground | a289089275bb9170f9598f72b2c1523cd0764409 | [
"Apache-2.0"
] | null | null | null | migrations/versions/e772522154a1_add_2_file_errors.py | itsjef/alembic-enum-playground | a289089275bb9170f9598f72b2c1523cd0764409 | [
"Apache-2.0"
] | null | null | null | """Add 2 file errors
Revision ID: e772522154a1
Revises: 74642fb71cb5
Create Date: 2021-11-29 00:44:48.579002
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "e772522154a1"
down_revision = "74642fb71cb5"
branch_labels = None
depends_on = None
def upgrade():
... | 23 | 67 | 0.645309 | import sqlalchemy as sa
from alembic import op
revision = "e772522154a1"
down_revision = "74642fb71cb5"
branch_labels = None
depends_on = None
def upgrade():
| true | true |
1c22077df1a4020b2a317416763eb07f305fecee | 4,064 | py | Python | data/synthetic_data/single_dim/two_states.py | HySynth/HySynth | b33b34ff5db138b5d007d0dcd32d53c9f8964b62 | [
"MIT"
] | 4 | 2021-03-05T11:18:35.000Z | 2021-12-09T18:51:32.000Z | data/synthetic_data/single_dim/two_states.py | HySynth/HySynth | b33b34ff5db138b5d007d0dcd32d53c9f8964b62 | [
"MIT"
] | null | null | null | data/synthetic_data/single_dim/two_states.py | HySynth/HySynth | b33b34ff5db138b5d007d0dcd32d53c9f8964b62 | [
"MIT"
] | null | null | null | """ This module contains a library of functions that generate data with two different states """
import numpy as np
from data.synthetic_data.generator import construct_signal_from_run, sloped_line_df, straight_line_df
from data.synthetic_data.visualisation import plot_data, plot_1D
@plot_data(plot_1D)
def zig_zag_l... | 29.449275 | 111 | 0.596949 |
import numpy as np
from data.synthetic_data.generator import construct_signal_from_run, sloped_line_df, straight_line_df
from data.synthetic_data.visualisation import plot_data, plot_1D
@plot_data(plot_1D)
def zig_zag_line():
sloped_lines_dict = {
"a": sloped_line_df(1),
"c": sloped_line_df(-1,... | true | true |
1c2208ea8a7d0e1e91c9876e6104c8d70c2a4ff0 | 3,253 | py | Python | benchmarking/cormorant/train_mutation.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | benchmarking/cormorant/train_mutation.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | benchmarking/cormorant/train_mutation.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | #
# Cormorant training script for the residue deletion dataset
#
import logging
import torch
from cormorant.data.collate import collate_siamese
from cormorant.data.utils import initialize_datasets
from cormorant.engine import Engine
from cormorant.engine import init_argparse, init_file_paths, init_logger, init_cuda
f... | 39.192771 | 154 | 0.65478 |
import logging
import torch
from cormorant.data.collate import collate_siamese
from cormorant.data.utils import initialize_datasets
from cormorant.engine import Engine
from cormorant.engine import init_argparse, init_file_paths, init_logger, init_cuda
from cormorant.engine import init_optimizer, init_scheduler
fro... | true | true |
1c220917f24cb1cb7004f24c4acbfac1ea55cac1 | 433 | py | Python | datafunctions/model/models/__init__.py | Lambda-School-Labs/Job-Funnl-ds-2 | 3603964839a8946363f9238b091aba9abace7d0d | [
"MIT"
] | 1 | 2020-03-12T20:07:17.000Z | 2020-03-12T20:07:17.000Z | datafunctions/model/models/__init__.py | Lambda-School-Labs/Job-Funnl-ds-2 | 3603964839a8946363f9238b091aba9abace7d0d | [
"MIT"
] | 2 | 2020-05-02T00:16:16.000Z | 2021-08-23T20:41:52.000Z | datafunctions/model/models/__init__.py | Lambda-School-Labs/Job-Funnl-ds-2 | 3603964839a8946363f9238b091aba9abace7d0d | [
"MIT"
] | 5 | 2020-03-05T17:19:15.000Z | 2020-03-26T13:44:15.000Z | # Slightly hacky way to import all local files
# Courtesy of: https://stackoverflow.com/a/1057534/12706019
from os.path import dirname, basename, isfile, join
import glob
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
#... | 48.111111 | 92 | 0.752887 |
from os.path import dirname, basename, isfile, join
import glob
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
from datafunctions.model.models import *
| true | true |
1c220a7987b1443ff9c37d0376a69fae069c916b | 940 | py | Python | sdks/python/test/test_ApiTokenResponsev2.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_ApiTokenResponsev2.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_ApiTokenResponsev2.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 23.5 | 95 | 0.723404 |
from __future__ import absolute_import
import unittest
import appcenter_sdk
from ApiTokenResponsev2.clsApiTokenResponsev2 import ApiTokenResponsev2
from appcenter_sdk.rest import ApiException
class TestApiTokenResponsev2(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pa... | true | true |
1c220cc7cee4781136c025eb2f1c497e4e7870fb | 4,662 | py | Python | data_helpers.py | SpearOfBayes/text_cnn_wiki | 4296ddb4c589a4caf3213dfde8a8142ee6a9e1ed | [
"Apache-2.0"
] | 1 | 2019-04-12T08:44:38.000Z | 2019-04-12T08:44:38.000Z | data_helpers.py | SpearOfBayes/text_cnn_wiki | 4296ddb4c589a4caf3213dfde8a8142ee6a9e1ed | [
"Apache-2.0"
] | null | null | null | data_helpers.py | SpearOfBayes/text_cnn_wiki | 4296ddb4c589a4caf3213dfde8a8142ee6a9e1ed | [
"Apache-2.0"
] | null | null | null | import numpy as np
import re
import jieba
import jieba.analyse
from encode_table import labels
from tqdm import *
label_dic = {}
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except for SST.
Original taken from https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py
... | 29.884615 | 103 | 0.596311 | import numpy as np
import re
import jieba
import jieba.analyse
from encode_table import labels
from tqdm import *
label_dic = {}
def clean_str(string):
string = re.sub(r"[^A-Za-z0-9(),!?\'\`]", " ", string)
string = re.sub(r"\'s", " \'s", string)
string = re.sub(r"\'ve", " \'ve", string)
string = re.s... | true | true |
1c220cef69772f3a034b955ffe97654080d11b02 | 10,938 | py | Python | tests/analyzers/morphological/test_pronoun_morphological_analyzer.py | fidelisrafael/esperanto-analyzer | af1e8609ec0696e3d1975aa0ba0c88e5f04f8468 | [
"BSD-2-Clause"
] | 18 | 2018-09-05T00:46:47.000Z | 2021-12-08T08:54:35.000Z | tests/analyzers/morphological/test_pronoun_morphological_analyzer.py | fidelisrafael/esperanto-analyzer | af1e8609ec0696e3d1975aa0ba0c88e5f04f8468 | [
"BSD-2-Clause"
] | null | null | null | tests/analyzers/morphological/test_pronoun_morphological_analyzer.py | fidelisrafael/esperanto-analyzer | af1e8609ec0696e3d1975aa0ba0c88e5f04f8468 | [
"BSD-2-Clause"
] | 3 | 2019-03-12T17:54:18.000Z | 2020-01-11T13:05:03.000Z | # pylint: disable=missing-docstring,no-self-use
import re
import pytest
from context import esperanto_analyzer
from esperanto_analyzer.speech import Pronoun
from esperanto_analyzer.analyzers.morphological import PronounMorphologicalAnalyzer
class TestPronounMorphologicalAnalyzerBasic():
TEST_WORD = 'mi'
de... | 39.064286 | 100 | 0.670781 |
import re
import pytest
from context import esperanto_analyzer
from esperanto_analyzer.speech import Pronoun
from esperanto_analyzer.analyzers.morphological import PronounMorphologicalAnalyzer
class TestPronounMorphologicalAnalyzerBasic():
TEST_WORD = 'mi'
def test_import(self):
assert PronounMorp... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.