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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1053abfb4d2f086b2a94f7679a970a5bd269e2 | 3,327 | py | Python | env/lib/python2.7/site-packages/pip/utils/logging.py | lindamar/ecclesi | cad07fc78daf6facd1b74cc1cb1872aaf4771fa2 | [
"MIT"
] | 168 | 2015-05-29T13:56:01.000Z | 2022-02-17T07:38:17.000Z | pip/utils/logging.py | alex/pip | d51a4b345b31ec4c8defbefe7f12b996c00c67fa | [
"MIT"
] | 3,243 | 2017-02-07T15:30:01.000Z | 2022-03-31T16:42:19.000Z | pip/utils/logging.py | alex/pip | d51a4b345b31ec4c8defbefe7f12b996c00c67fa | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
# Lots of differen... | 25.396947 | 77 | 0.643823 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
from pip.utils import ensure_dir
try:
from pip._vendor import colorama
except Exception:
... | true | true |
1c1053e734974ce15745afaa0c1dd7fd2a020d58 | 37,697 | py | Python | src/v5.1/resources/swagger_client/api/teacher_preparation_providers_api.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 2 | 2021-04-27T17:18:17.000Z | 2021-04-27T19:14:39.000Z | src/v5.1/resources/swagger_client/api/teacher_preparation_providers_api.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | null | null | null | src/v5.1/resources/swagger_client/api/teacher_preparation_providers_api.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 1 | 2022-01-06T09:43:11.000Z | 2022-01-06T09:43:11.000Z | # coding: utf-8
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reas... | 53.623044 | 493 | 0.666499 |
from __future__ import absolute_import
import re
import six
from swagger_client.api_client import ApiClient
class TeacherPreparationProvidersApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def d... | true | true |
1c10556349e60f879b57c5dfcc1982722a49aab4 | 166 | py | Python | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_LinearTrend_Seasonal_WeekOfYear_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_LinearTrend_Seasonal_WeekOfYear_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_LinearTrend_Seasonal_WeekOfYear_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Fisher'] , ['LinearTrend'] , ['Seasonal_WeekOfYear'] , ['MLP'] ); | 41.5 | 88 | 0.759036 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Fisher'] , ['LinearTrend'] , ['Seasonal_WeekOfYear'] , ['MLP'] ); | true | true |
1c10558af6250238d2bfa46e40be8e0418232c74 | 4,511 | py | Python | src/scoreboard.py | wsh32/FantasyFRC | ed9ba1207c99856ae6a37ab1db4fb657b6d9d7f3 | [
"MIT"
] | null | null | null | src/scoreboard.py | wsh32/FantasyFRC | ed9ba1207c99856ae6a37ab1db4fb657b6d9d7f3 | [
"MIT"
] | null | null | null | src/scoreboard.py | wsh32/FantasyFRC | ed9ba1207c99856ae6a37ab1db4fb657b6d9d7f3 | [
"MIT"
] | null | null | null | from oauth2client.service_account import ServiceAccountCredentials
import gspread
from tba import *
import draft
import settings
import threading
"""scoreboard.py: Automatically updates the scoreboard. Thanks TBA"""
TITLE = settings.SCOREBOARD_TITLE
def auth(creds_file):
scope = [
'https://spreadsheets.g... | 26.226744 | 105 | 0.591665 | from oauth2client.service_account import ServiceAccountCredentials
import gspread
from tba import *
import draft
import settings
import threading
TITLE = settings.SCOREBOARD_TITLE
def auth(creds_file):
scope = [
'https://spreadsheets.google.com/feeds',
'https://www.googleapis.com/auth/drive.file'... | true | true |
1c1058e40a97917d55fee30d8206992cef5d9668 | 2,258 | py | Python | clone/migrations/0001_initial.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | clone/migrations/0001_initial.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | clone/migrations/0001_initial.py | samsoluoch/Instagram | ea6305c0592c8efe173cf3e6b5f1c477650678db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-03 11:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | 35.28125 | 114 | 0.550044 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Comments',
fields=[
... | true | true |
1c1059571c0bc97e157b10c33f8585a4e2e222a3 | 318,134 | py | Python | src/sage/combinat/posets/posets.py | dimpase/sagetrac-mirror | 473cd41f19ec23df7e207391cfb0cf41c7c4ef46 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/posets/posets.py | dimpase/sagetrac-mirror | 473cd41f19ec23df7e207391cfb0cf41c7c4ef46 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/posets/posets.py | dimpase/sagetrac-mirror | 473cd41f19ec23df7e207391cfb0cf41c7c4ef46 | [
"BSL-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
r"""
Finite posets
This module implements finite partially ordered sets. It defines:
.. csv-table::
:class: contentstable
:widths: 30, 70
:delim: |
:class:`FinitePoset` | A class for finite posets
:class:`FinitePosets_n` | A class for finite posets up to isomorphism (i.e. ... | 35.645266 | 457 | 0.536937 |
from copy import copy, deepcopy
from sage.misc.cachefunc import cached_method
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.misc_c import prod
from sage.functions.other import floor
from sage.functions.other import binomial
from sage.categories.category import Category
from sage.categories.sets_c... | true | true |
1c1059acdf0266d4c820c6fbe18acb71e6193e27 | 182 | py | Python | puppyshelter/views/__init__.py | iraquitan/udacity-fsnd-puppy-shelter | 9eff74fd6341fa7ae84682101016e5661390fa80 | [
"MIT"
] | null | null | null | puppyshelter/views/__init__.py | iraquitan/udacity-fsnd-puppy-shelter | 9eff74fd6341fa7ae84682101016e5661390fa80 | [
"MIT"
] | null | null | null | puppyshelter/views/__init__.py | iraquitan/udacity-fsnd-puppy-shelter | 9eff74fd6341fa7ae84682101016e5661390fa80 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
* Project: puppy-shelter
* Author name: Iraquitan Cordeiro Filho
* Author login: iraquitan
* File: __init__.py
* Date: 2/16/16
* Time: 12:15 AM
"""
| 18.2 | 40 | 0.626374 | true | true | |
1c1059cc4271fe188f742965ad2617554e2e5ec4 | 415 | py | Python | hydra_notebook_site/wsgi.py | lordoftheflies/hydra-notebook | eab70f082a1dbbc85e27c3114994b61031cf3cd8 | [
"Apache-2.0"
] | null | null | null | hydra_notebook_site/wsgi.py | lordoftheflies/hydra-notebook | eab70f082a1dbbc85e27c3114994b61031cf3cd8 | [
"Apache-2.0"
] | 4 | 2020-02-11T22:59:43.000Z | 2021-06-10T20:32:57.000Z | hydra_notebook_site/wsgi.py | lordoftheflies/hydra-notebook | eab70f082a1dbbc85e27c3114994b61031cf3cd8 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for hydra_notebook_site project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("... | 24.411765 | 79 | 0.79759 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hydra_notebook_site.settings")
application = get_wsgi_application()
| true | true |
1c105bee084f534162602287483c302a983aec67 | 376 | py | Python | URI2140.py | rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3 | c7db434e2e6e40c2ca3bd56db0d04cf79f69de12 | [
"Apache-2.0"
] | 2 | 2020-07-21T18:01:37.000Z | 2021-11-29T01:08:14.000Z | URI2140.py | rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3 | c7db434e2e6e40c2ca3bd56db0d04cf79f69de12 | [
"Apache-2.0"
] | null | null | null | URI2140.py | rashidulhasanhridoy/URI-Online-Judge-Problem-Solve-with-Python-3 | c7db434e2e6e40c2ca3bd56db0d04cf79f69de12 | [
"Apache-2.0"
] | null | null | null | bills = [7, 12, 22, 52, 102, 15, 25, 55, 105, 30, 60, 110, 70, 120, 150]
count = 0
while True:
N, M = map(int, input().split())
if N == 0 and M == 0:
break
for i in bills:
if M - N == i:
count = 1
break
else:
count = 0
if count == 1:
pr... | 19.789474 | 72 | 0.433511 | bills = [7, 12, 22, 52, 102, 15, 25, 55, 105, 30, 60, 110, 70, 120, 150]
count = 0
while True:
N, M = map(int, input().split())
if N == 0 and M == 0:
break
for i in bills:
if M - N == i:
count = 1
break
else:
count = 0
if count == 1:
pr... | true | true |
1c105c13f1289c72db0c4d7e3945159d4b76994b | 537 | py | Python | chars/hud_scripts/targetMode.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 27 | 2016-01-13T14:16:13.000Z | 2022-01-03T05:38:44.000Z | chars/hud_scripts/targetMode.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 1 | 2017-04-29T00:51:26.000Z | 2017-04-29T00:54:43.000Z | chars/hud_scripts/targetMode.py | camsdu59/Zelda_BlenderGame | 0f5d5d15bfa79e9f8ea15f0ebcb76bce92f77a21 | [
"FSFAP"
] | 14 | 2016-01-20T21:02:37.000Z | 2020-07-19T05:47:20.000Z | from bge import logic
cont = logic.getCurrentController()
def main(cont):
own = cont.owner
try :
if (logic.globalDict['target_mode']):
cont.deactivate('no_active')
cont.activate('active')
if (own['target'] == False):
cont.activate('target_... | 25.571429 | 46 | 0.506518 | from bge import logic
cont = logic.getCurrentController()
def main(cont):
own = cont.owner
try :
if (logic.globalDict['target_mode']):
cont.deactivate('no_active')
cont.activate('active')
if (own['target'] == False):
cont.activate('target_... | true | true |
1c105c8817e46aec7274c118199b4f972be22112 | 3,622 | py | Python | scio-worker.py | sbrom/act-workers | 23a5fce2909f8300de706926284cbf18d9ae10fd | [
"ISC"
] | null | null | null | scio-worker.py | sbrom/act-workers | 23a5fce2909f8300de706926284cbf18d9ae10fd | [
"ISC"
] | null | null | null | scio-worker.py | sbrom/act-workers | 23a5fce2909f8300de706926284cbf18d9ae10fd | [
"ISC"
] | null | null | null | #!/usr/bin/env python3
"""NiFi worker to pass Scio produced data to the ACT platform"""
import sys
import argparse
import json
from logging import error
import traceback
import act
EXTRACT_GEONAMES = ["countries", "regions", "regions-derived",
"sub-regions", "sub-regions-derived"]
EXTRACT_INDIC... | 28.296875 | 97 | 0.591386 |
import sys
import argparse
import json
from logging import error
import traceback
import act
EXTRACT_GEONAMES = ["countries", "regions", "regions-derived",
"sub-regions", "sub-regions-derived"]
EXTRACT_INDICATORS = ["md5", "sha1", "sha256",
"fqdn", "ipv4", "ipv6", "email",... | true | true |
1c105ce894137ce4320b38da14c1c90eecd6817a | 23,431 | py | Python | tools/wptrunner/wptrunner/manifestupdate.py | birtles/web-platform-tests | 39f866d238429abfdfef054289672e9eec75530d | [
"BSD-3-Clause"
] | null | null | null | tools/wptrunner/wptrunner/manifestupdate.py | birtles/web-platform-tests | 39f866d238429abfdfef054289672e9eec75530d | [
"BSD-3-Clause"
] | null | null | null | tools/wptrunner/wptrunner/manifestupdate.py | birtles/web-platform-tests | 39f866d238429abfdfef054289672e9eec75530d | [
"BSD-3-Clause"
] | null | null | null | import itertools
import os
import urlparse
from collections import namedtuple, defaultdict
from wptmanifest.node import (DataNode, ConditionalNode, BinaryExpressionNode,
BinaryOperatorNode, VariableNode, StringNode, NumberNode,
UnaryExpressionNode, UnaryOpera... | 37.852989 | 113 | 0.628868 | import itertools
import os
import urlparse
from collections import namedtuple, defaultdict
from wptmanifest.node import (DataNode, ConditionalNode, BinaryExpressionNode,
BinaryOperatorNode, VariableNode, StringNode, NumberNode,
UnaryExpressionNode, UnaryOpera... | false | true |
1c105cf999c6c9b17f6528b6b4b5f223fd391864 | 24,174 | py | Python | core/lib/sql.py | ahmed1231234/OnlineSchemaChange | f0e9441bcd7704da5263535952f599ed9b239c6c | [
"BSD-3-Clause"
] | null | null | null | core/lib/sql.py | ahmed1231234/OnlineSchemaChange | f0e9441bcd7704da5263535952f599ed9b239c6c | [
"BSD-3-Clause"
] | null | null | null | core/lib/sql.py | ahmed1231234/OnlineSchemaChange | f0e9441bcd7704da5263535952f599ed9b239c6c | [
"BSD-3-Clause"
] | 1 | 2020-06-30T09:37:44.000Z | 2020-06-30T09:37:44.000Z | """
Copyright (c) 2017-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
from __future__ import abs... | 30.794904 | 78 | 0.605361 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
get_lock = 'SELECT get_lock(%s, 0) as lockstatus'
release_lock = 'SELECT release_lock(%s) as lockstatus'
stop_slave_sql = "STOP SLAVE SQL_THREAD"
start_slave_sql = "ST... | true | true |
1c105dfeff6980a73796452b08859781bae6a889 | 1,174 | py | Python | api_study/apps/users/models.py | shidashui/django_restful_api_study | 4957bbfb39ea16e4760d2b943578753a7183e266 | [
"MIT"
] | 2 | 2019-11-13T05:05:19.000Z | 2019-11-13T05:08:41.000Z | api_study/apps/users/models.py | shidashui/django_restful_api_study | 4957bbfb39ea16e4760d2b943578753a7183e266 | [
"MIT"
] | null | null | null | api_study/apps/users/models.py | shidashui/django_restful_api_study | 4957bbfb39ea16e4760d2b943578753a7183e266 | [
"MIT"
] | null | null | null | import datetime
from django.contrib.auth.models import AbstractUser
from django.db import models
# Create your models here.
class UserProfile(AbstractUser):
"""
用户信息
"""
GENDER_CHOICES = (
("male", "男"),
("female", "女")
)
#用户用手机注册,所以姓名,生日和邮箱可以为空
name = models.CharField("姓名"... | 26.681818 | 88 | 0.660136 | import datetime
from django.contrib.auth.models import AbstractUser
from django.db import models
class UserProfile(AbstractUser):
GENDER_CHOICES = (
("male", "男"),
("female", "女")
)
name = models.CharField("姓名", max_length=30, null=True, blank=True)
birthday = models.DateField("出生年... | true | true |
1c105ff8df6a399734be459e318f8615c58d281a | 629 | py | Python | flask_web/__init__.py | KevinDryfuse/christmas-tree-stand-monitor-service | 241846587f7e2b35548e2876221ccbec2b41c9dc | [
"MIT"
] | null | null | null | flask_web/__init__.py | KevinDryfuse/christmas-tree-stand-monitor-service | 241846587f7e2b35548e2876221ccbec2b41c9dc | [
"MIT"
] | null | null | null | flask_web/__init__.py | KevinDryfuse/christmas-tree-stand-monitor-service | 241846587f7e2b35548e2876221ccbec2b41c9dc | [
"MIT"
] | null | null | null | from flask import Flask
from config import Config
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
db = SQLAlchemy()
migrate = Migrate()
bootstrap = Bootstrap()
def create_app(config_class=Config):
app = Flask(__name__)
app.config.from_object(co... | 20.290323 | 48 | 0.766296 | from flask import Flask
from config import Config
from flask_bootstrap import Bootstrap
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
db = SQLAlchemy()
migrate = Migrate()
bootstrap = Bootstrap()
def create_app(config_class=Config):
app = Flask(__name__)
app.config.from_object(co... | true | true |
1c10602d963d793feaade95ca7709517c5ebdd76 | 1,602 | py | Python | ccoin/dict_tools.py | Rustem/toychain | dafc445e66af8a18c4b007b20b15f9612b825529 | [
"MIT"
] | 3 | 2018-05-01T09:13:00.000Z | 2018-06-26T03:01:07.000Z | ccoin/dict_tools.py | Rustem/toychain | dafc445e66af8a18c4b007b20b15f9612b825529 | [
"MIT"
] | null | null | null | ccoin/dict_tools.py | Rustem/toychain | dafc445e66af8a18c4b007b20b15f9612b825529 | [
"MIT"
] | null | null | null | import contextlib
def merge_deep(source, destination):
"""
>>> a = { 'first' : { 'all_rows' : { 'pass' : 'dog', 'number' : '1' } } }
>>> b = { 'first' : { 'all_rows' : { 'fail' : 'cat', 'number' : '5' } } }
>>> merge_deep(b, a) == { 'first' : { 'all_rows' : { 'pass' : 'dog', 'fail' : 'cat', 'number' :... | 26.7 | 109 | 0.533084 | import contextlib
def merge_deep(source, destination):
for key, value in source.items():
if isinstance(value, dict):
node = destination.setdefault(key, {})
destination[key] = merge_deep(value, node)
else:
destination[key] = value
return destinat... | true | true |
1c10604b5bba9b1d5028550400573c35ed507a69 | 981 | py | Python | notes/algo-ds-practice/problems/matrix/largest_square_submatrix_boundary.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 6 | 2020-07-05T05:15:19.000Z | 2021-01-24T20:17:14.000Z | notes/algo-ds-practice/problems/matrix/largest_square_submatrix_boundary.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | null | null | null | notes/algo-ds-practice/problems/matrix/largest_square_submatrix_boundary.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 2 | 2020-09-14T06:46:37.000Z | 2021-06-15T09:17:21.000Z | '''
Given a matrix, consisting of characters 'X' and 'O', find the largest square submatrix having X at all the boundary elements.
SOLUTION:
DP:
Let dp[i][j] denote the largest contiguous X 1-D array ending at matrix[i][j] in the ith row and jthe column.
Meaning that lets at dp[5][7] = (2, 5). It means that there is ... | 37.730769 | 174 | 0.685015 | true | true | |
1c1060a3d1b029506a9d4691f23e19adf33b8951 | 59,626 | py | Python | salt/states/boto_elb.py | izhukov/salt | f83e81371a0e480db1ff43512f0cb4082c91d0fa | [
"Apache-2.0"
] | null | null | null | salt/states/boto_elb.py | izhukov/salt | f83e81371a0e480db1ff43512f0cb4082c91d0fa | [
"Apache-2.0"
] | null | null | null | salt/states/boto_elb.py | izhukov/salt | f83e81371a0e480db1ff43512f0cb4082c91d0fa | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage ELBs
.. versionadded:: 2014.7.0
Create and destroy ELBs. Be aware that this interacts with Amazon's
services, and so may incur charges.
This module uses ``boto``, which can be installed via package, or pip.
This module accepts explicit elb credentials but can also utilize
IAM role... | 39.201841 | 115 | 0.531513 |
from __future__ import absolute_import
import logging
import hashlib
import re
import salt.utils.dictupdate as dictupdate
from salt.utils import exactly_one
from salt.exceptions import SaltInvocationError
import salt.ext.six as six
log = logging.getLogger(__name__)
def __virtual__():
return 'boto_elb' if 'boto... | true | true |
1c10615b703382776ee27a9405db4e5485de3d7b | 272 | py | Python | tests/artificial/transf_Difference/trend_PolyTrend/cycle_12/ar_12/test_artificial_32_Difference_PolyTrend_12_12_100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/artificial/transf_Difference/trend_PolyTrend/cycle_12/ar_12/test_artificial_32_Difference_PolyTrend_12_12_100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/artificial/transf_Difference/trend_PolyTrend/cycle_12/ar_12/test_artificial_32_Difference_PolyTrend_12_12_100.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 100, ar_order = 12); | 38.857143 | 167 | 0.735294 | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 100, ar_order = 12); | true | true |
1c106181790c50497109c1ed94798bd115c042da | 1,418 | py | Python | RCLSTM/xml2csv.py | jinjieyu/RCLSTM | 0f70617966cf4f21c4459cf321cea06db5b5c7c2 | [
"MIT"
] | 4 | 2019-06-16T11:23:57.000Z | 2019-09-21T13:36:29.000Z | RCLSTM/xml2csv.py | jinjieyu/RCLSTM | 0f70617966cf4f21c4459cf321cea06db5b5c7c2 | [
"MIT"
] | null | null | null | RCLSTM/xml2csv.py | jinjieyu/RCLSTM | 0f70617966cf4f21c4459cf321cea06db5b5c7c2 | [
"MIT"
] | 9 | 2020-10-19T06:12:26.000Z | 2021-01-17T07:09:48.000Z | # encoding: utf-8
"""
@author: huayuxiu
Transform xml files to csv files.
The original traffic data are from GEANT, https://totem.info.ucl.ac.be/dataset.html
Please refer to data.pdf for the description of the traffic data
"""
import xml.etree.cElementTree as et
import numpy as np
import os
# path of xml files
xml_... | 26.259259 | 83 | 0.652327 |
import xml.etree.cElementTree as et
import numpy as np
import os
xml_path = './data/traffic-matrices/'
csv_path = './data/csv/'
xml_count = 0
csv_count = 0
for filename in os.listdir(xml_path):
xml_count += 1
tree= et.parse(os.path.join(xml_path, filename))
root = tree.getroot()
IntraTM = root.get... | true | true |
1c1061a2cd3f849fa0401573c3b3e7d9332fc3a4 | 2,022 | py | Python | src/wordperil/model/puzzleset.py | CodeMouse92/wordperil | 798a93de9887167bfe05adfe780259cf4c2dc998 | [
"BSD-3-Clause"
] | 1 | 2020-07-16T15:33:52.000Z | 2020-07-16T15:33:52.000Z | src/wordperil/model/puzzleset.py | CodeMouse92/wordperil | 798a93de9887167bfe05adfe780259cf4c2dc998 | [
"BSD-3-Clause"
] | 3 | 2020-07-24T14:35:24.000Z | 2021-03-24T22:05:45.000Z | src/wordperil/model/puzzleset.py | CodeMouse92/wordperil | 798a93de9887167bfe05adfe780259cf4c2dc998 | [
"BSD-3-Clause"
] | 3 | 2020-07-23T20:22:34.000Z | 2021-07-17T05:28:00.000Z | import random
import json
from .puzzle import Puzzle
from .usedcache import UsedCache
class Puzzleset:
loaded = None
@classmethod
def loadFromPath(cls, path):
try:
cls.loaded = Puzzleset(path)
except (FileNotFoundError, NotADirectoryError):
raise FileNotFoundErro... | 28.885714 | 76 | 0.590999 | import random
import json
from .puzzle import Puzzle
from .usedcache import UsedCache
class Puzzleset:
loaded = None
@classmethod
def loadFromPath(cls, path):
try:
cls.loaded = Puzzleset(path)
except (FileNotFoundError, NotADirectoryError):
raise FileNotFoundErro... | true | true |
1c1061ac4b2b22cfec6a354be38aa35d87159762 | 1,436 | py | Python | clients/python/sysadmin/ConfigTemplateRenderer.py | kcollinssibley/sysadmin | 81b6c424f7d9d5c25724cd1f544902ff3ff62cc2 | [
"Apache-2.0"
] | 14 | 2017-05-31T19:38:25.000Z | 2022-01-19T20:56:32.000Z | clients/python/sysadmin/ConfigTemplateRenderer.py | kcollinssibley/sysadmin | 81b6c424f7d9d5c25724cd1f544902ff3ff62cc2 | [
"Apache-2.0"
] | 26 | 2017-06-07T14:05:07.000Z | 2020-01-29T20:06:34.000Z | clients/python/sysadmin/ConfigTemplateRenderer.py | kcollinssibley/sysadmin | 81b6c424f7d9d5c25724cd1f544902ff3ff62cc2 | [
"Apache-2.0"
] | 9 | 2017-05-31T21:09:59.000Z | 2021-05-14T15:11:18.000Z | import json
import os
from jinja2 import Environment
from jinja2 import FileSystemBytecodeCache
from jinja2 import FileSystemLoader
try:
from sysadmin_helpers import helpers
except ImportError:
helpers = None
CACHE_DIR = "/tmp/sysadmin_jinja_cache"
class ConfigTemplateRenderer:
def __init__(self, temp... | 32.636364 | 71 | 0.572423 | import json
import os
from jinja2 import Environment
from jinja2 import FileSystemBytecodeCache
from jinja2 import FileSystemLoader
try:
from sysadmin_helpers import helpers
except ImportError:
helpers = None
CACHE_DIR = "/tmp/sysadmin_jinja_cache"
class ConfigTemplateRenderer:
def __init__(self, temp... | true | true |
1c1061b548a9bb2a386e47a87e3f2587ceea9491 | 373 | py | Python | Python Exercises/Mundo1/exercicio23.py | joaopblume/Curso-em-video-exercicios | d554c0c07c8d65b3a219d76fc487a78c11eaf874 | [
"MIT"
] | null | null | null | Python Exercises/Mundo1/exercicio23.py | joaopblume/Curso-em-video-exercicios | d554c0c07c8d65b3a219d76fc487a78c11eaf874 | [
"MIT"
] | null | null | null | Python Exercises/Mundo1/exercicio23.py | joaopblume/Curso-em-video-exercicios | d554c0c07c8d65b3a219d76fc487a78c11eaf874 | [
"MIT"
] | null | null | null | # Faça um progrma que leia os números de 0 a 9999
# e mostre na tela cada um dos dígitos separados.
num = int(input('Digite um número entre 0 e 9999: '))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print(f'Analaisando o número {num}...')
print(f'Unidade = {u}.')
print(f'Dezena = {d}.... | 23.3125 | 53 | 0.605898 |
num = int(input('Digite um número entre 0 e 9999: '))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print(f'Analaisando o número {num}...')
print(f'Unidade = {u}.')
print(f'Dezena = {d}.')
print(f'Centena = {c}.')
print(f'Milhar = {m}.')
| true | true |
1c1064177d735966b8eedc6e90689fba842679f9 | 10,140 | py | Python | client/app.py | topher-lo/datathon-starter-abandoned | 94d33378c165842fcc149fc5ff83ca1e2f8eddf5 | [
"MIT"
] | 3 | 2021-02-26T11:49:59.000Z | 2021-02-27T13:23:15.000Z | client/app.py | topher-lo/streamlit-e2e-boilerplate | 94d33378c165842fcc149fc5ff83ca1e2f8eddf5 | [
"MIT"
] | 3 | 2021-04-20T05:27:28.000Z | 2021-04-21T02:32:26.000Z | client/app.py | topher-lo/datathon-starter-abandoned | 94d33378c165842fcc149fc5ff83ca1e2f8eddf5 | [
"MIT"
] | null | null | null | """Runs the streamlit app.
Call this file in the terminal (from the `datathon-starter` dir)
via `streamlit run app.py`.
"""
import pandas as pd
import streamlit as st
import missingno as msno
import time
from pandas_profiling import ProfileReport
from streamlit_pandas_profiling import st_profile_report
from typing im... | 37.695167 | 82 | 0.591815 |
import pandas as pd
import streamlit as st
import missingno as msno
import time
from pandas_profiling import ProfileReport
from streamlit_pandas_profiling import st_profile_report
from typing import List
from typing import Mapping
from prefect.client.client import Client
from prefect.tasks.prefect.flow_run import S... | true | true |
1c1064b69f1f7c20e050f823bd470f0be64f1b54 | 3,477 | py | Python | tools/ota_e2e_tests/aws_ota_test/aws_ota_test_case_factory.py | NoMaY-tmp/ex2 | 2e6aaea2a7093112e3ae8440ee9abb4dc9ff9a51 | [
"MIT"
] | 10 | 2019-09-10T11:20:19.000Z | 2021-08-10T02:14:57.000Z | tools/ota_e2e_tests/aws_ota_test/aws_ota_test_case_factory.py | dyg540/amazon-freertos | 3d61ed00f018ac6ec0df2031556dbb71bf03617d | [
"MIT"
] | 19 | 2018-12-07T03:41:15.000Z | 2020-02-05T14:42:04.000Z | tools/ota_e2e_tests/aws_ota_test/aws_ota_test_case_factory.py | dyg540/amazon-freertos | 3d61ed00f018ac6ec0df2031556dbb71bf03617d | [
"MIT"
] | 11 | 2018-08-03T10:15:33.000Z | 2020-12-07T03:26:10.000Z | """
Amazon FreeRTOS
Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation t... | 51.895522 | 92 | 0.839804 | from .aws_ota_test_case_greater_version import OtaTestGreaterVersion
from .aws_ota_test_case_unsigned_image import OtaTestUnsignedImage
from .aws_ota_test_case_same_version import OtaTestSameVersion
from .aws_ota_test_case_untrusted_certificate import OtaTestUntrustedCertificate
from .aws_ota_test_case_corrupt_image_be... | true | true |
1c106534bf8ccfec1cfb712b639fd0ca900c16c8 | 787 | py | Python | msaf/experiment/jams2/fileio.py | m-tian/msaf-copy | 614bba6686fd0abf3c5866b92d78fccf5186b6a3 | [
"MIT"
] | 1 | 2020-02-17T08:14:16.000Z | 2020-02-17T08:14:16.000Z | msaf/experiment/jams2/fileio.py | m-tian/msaf-copy | 614bba6686fd0abf3c5866b92d78fccf5186b6a3 | [
"MIT"
] | null | null | null | msaf/experiment/jams2/fileio.py | m-tian/msaf-copy | 614bba6686fd0abf3c5866b92d78fccf5186b6a3 | [
"MIT"
] | 1 | 2020-02-14T08:57:35.000Z | 2020-02-14T08:57:35.000Z | """CPickle style methods for reading / writing JAMS.
TODO(ejhumphrey@nyu.edu): merge / append definition, for safely writing the
union of two JAMS to disk.
"""
import json
from pyjams import Jams
def load(filepath):
"""Load a JSON formatted stream from a file."""
fpointer = open(filepath, 'r')
return... | 26.233333 | 75 | 0.684879 | import json
from pyjams import Jams
def load(filepath):
fpointer = open(filepath, 'r')
return Jams(**json.load(fpointer))
def dump(jam, filepath):
fpointer = open(filepath, 'w')
json.dump(jam, fpointer, indent=2)
fpointer.close()
def append(jam, filepath, new_filepath=None, on_conflict='fail')... | true | true |
1c1065d49ded0ad6c0dec90ef03088f647ef5bf2 | 2,606 | py | Python | src/app_engine/constants.py | JinXing210/appRTC | 4bfefbf189975d4d0840eecabac47e61212617ca | [
"BSD-3-Clause"
] | null | null | null | src/app_engine/constants.py | JinXing210/appRTC | 4bfefbf189975d4d0840eecabac47e61212617ca | [
"BSD-3-Clause"
] | null | null | null | src/app_engine/constants.py | JinXing210/appRTC | 4bfefbf189975d4d0840eecabac47e61212617ca | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 Google Inc. All Rights Reserved.
"""AppRTC Constants.
This module contains the constants used in AppRTC Python modules.
"""
import os
# Deprecated domains which we should to redirect to REDIRECT_URL.
REDIRECT_DOMAINS = [
'rtc.intopi.com'
]
# URL which we should redirect to if matching in REDIRECT... | 29.280899 | 77 | 0.755564 |
import os
REDIRECT_DOMAINS = [
'rtc.intopi.com'
]
REDIRECT_URL = 'rtc.intopi.com'
ROOM_MEMCACHE_EXPIRATION_SEC = 60 * 60 * 24
MEMCACHE_RETRY_LIMIT = 100
LOOPBACK_CLIENT_ID = 'LOOPBACK_CLIENT_ID'
ICE_SERVER_OVERRIDE = [
{
"urls": [
"turn:hostname/69.79.26.13:3478?transport=udp",
"turn:hostname... | true | true |
1c106793592bf797304127b11ff6b8ae55b2f902 | 472 | py | Python | cryptofeed_werks/management/commands/trades.py | globophobe/crypto-tick-data | 7ec5d1e136b9bc27ae936f55cf6ab7fe5e37bda4 | [
"MIT"
] | null | null | null | cryptofeed_werks/management/commands/trades.py | globophobe/crypto-tick-data | 7ec5d1e136b9bc27ae936f55cf6ab7fe5e37bda4 | [
"MIT"
] | null | null | null | cryptofeed_werks/management/commands/trades.py | globophobe/crypto-tick-data | 7ec5d1e136b9bc27ae936f55cf6ab7fe5e37bda4 | [
"MIT"
] | null | null | null | from cryptofeed_werks.exchanges.api import exchange_api
from cryptofeed_werks.models import DailyTrades
from ..base import Command as BaseCommand
class Command(BaseCommand):
help = "Get trades from exchange API or S3"
target = exchange_api
def handle(self, *args, **options) -> None:
kwargs = sup... | 29.5 | 55 | 0.690678 | from cryptofeed_werks.exchanges.api import exchange_api
from cryptofeed_werks.models import DailyTrades
from ..base import Command as BaseCommand
class Command(BaseCommand):
help = "Get trades from exchange API or S3"
target = exchange_api
def handle(self, *args, **options) -> None:
kwargs = sup... | true | true |
1c1067f5228ff25ec2bf822f06fbe4b9d1b8a7ac | 1,892 | py | Python | keystone/conf/trust.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 1 | 2019-05-08T06:09:35.000Z | 2019-05-08T06:09:35.000Z | keystone/conf/trust.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 4 | 2018-08-22T14:51:02.000Z | 2018-10-17T14:04:26.000Z | keystone/conf/trust.py | Afkupuz/4jaewoo | fc69258feac7858f5af99d2feab39c86ceb70203 | [
"Apache-2.0"
] | 5 | 2018-08-03T17:19:34.000Z | 2019-01-11T15:54:42.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 27.823529 | 79 | 0.737844 |
from oslo_config import cfg
from keystone.conf import utils
enabled = cfg.BoolOpt(
'enabled',
default=True,
help=utils.fmt("""
Delegation and impersonation features using trusts can be optionally disabled.
"""))
allow_redelegation = cfg.BoolOpt(
'allow_redelegation',
default=False,
help=uti... | true | true |
1c106a1b0841c7f6feba6017d173fdba8fa08b47 | 2,632 | py | Python | datasets/tinyimagenet_resize.py | PatrickgHayes/gmm-dnn-for-interpretability | 83f88a5df726fbf4eacc68a679232e24c0d7b0f3 | [
"MIT"
] | null | null | null | datasets/tinyimagenet_resize.py | PatrickgHayes/gmm-dnn-for-interpretability | 83f88a5df726fbf4eacc68a679232e24c0d7b0f3 | [
"MIT"
] | null | null | null | datasets/tinyimagenet_resize.py | PatrickgHayes/gmm-dnn-for-interpretability | 83f88a5df726fbf4eacc68a679232e24c0d7b0f3 | [
"MIT"
] | null | null | null | # DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.
#
# This material is based upon work supported by the Assistant Secretary of Defense for Research and
# Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions,
# findings, conclusions or recommendat... | 39.878788 | 100 | 0.696809 |
from os import path
from datasets.domain_dataset import DomainDataset
from torchvision.transforms import transforms
class TinyImageNetResize(DomainDataset):
def __init__(self, root):
url = None
filename = "tinyimagenet-resize.tar.gz"
tgz_md5 = None
root = path.join(root, "tinyim... | true | true |
1c106a77c201c7cc2d1612e97d45539fa9c5dec6 | 35,578 | py | Python | tests/fixtures/tests.py | xavfernandez/django | daaeb8415823444a9020460cf825efc3fae866a2 | [
"BSD-3-Clause"
] | 2 | 2016-07-23T18:08:37.000Z | 2016-07-24T09:54:34.000Z | tests/fixtures/tests.py | xavfernandez/django | daaeb8415823444a9020460cf825efc3fae866a2 | [
"BSD-3-Clause"
] | null | null | null | tests/fixtures/tests.py | xavfernandez/django | daaeb8415823444a9020460cf825efc3fae866a2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import os
import warnings
from django.contrib.sites.models import Site
from django.core import management
from django.db import connection, IntegrityError
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from django.utils import six
from .models impor... | 81.228311 | 4,330 | 0.644668 | from __future__ import unicode_literals
import os
import warnings
from django.contrib.sites.models import Site
from django.core import management
from django.db import connection, IntegrityError
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from django.utils import six
from .models impor... | true | true |
1c106b2747af37a8f9e063f6470f1a478c8ada6a | 4,701 | py | Python | Generator.py | VanGy-code/3D-House-Blender | 8a9d91b1f3cc3988c0dcd7079223f2e541f9ec71 | [
"MIT"
] | null | null | null | Generator.py | VanGy-code/3D-House-Blender | 8a9d91b1f3cc3988c0dcd7079223f2e541f9ec71 | [
"MIT"
] | null | null | null | Generator.py | VanGy-code/3D-House-Blender | 8a9d91b1f3cc3988c0dcd7079223f2e541f9ec71 | [
"MIT"
] | 1 | 2021-11-22T00:50:45.000Z | 2021-11-22T00:50:45.000Z | import bpy
import os
import json
import numpy as np
from decimal import Decimal
from mathutils import Vector, Matrix
def clean():
# setting
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
links = tree.links
# Clear default nodes
for n in tree.nodes:
tree.nodes.rem... | 31.34 | 116 | 0.554776 | import bpy
import os
import json
import numpy as np
from decimal import Decimal
from mathutils import Vector, Matrix
def clean():
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
links = tree.links
for n in tree.nodes:
tree.nodes.remove(n)
try:
... | true | true |
1c106c4427fb73977c70e7d00894b1251bc7d3d5 | 1,724 | py | Python | keras/utils/all_utils.py | hdubbs/keras | 4967ce6f8f0199969ba40d74eba1bddc204ca100 | [
"Apache-2.0"
] | 1 | 2020-02-02T04:43:33.000Z | 2020-02-02T04:43:33.000Z | keras/utils/all_utils.py | CloudboySolutions/keras | b96518a22bfd92a29811e507dec0b34248a8a3f5 | [
"Apache-2.0"
] | null | null | null | keras/utils/all_utils.py | CloudboySolutions/keras | b96518a22bfd92a29811e507dec0b34248a8a3f5 | [
"Apache-2.0"
] | 1 | 2020-12-13T22:14:48.000Z | 2020-12-13T22:14:48.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 45.368421 | 80 | 0.787123 |
from keras.utils.data_utils import GeneratorEnqueuer
from keras.utils.data_utils import get_file
from keras.utils.data_utils import OrderedEnqueuer
from keras.utils.data_utils import Sequence
from keras.utils.data_utils import SequenceEnqueuer
from keras.utils.generic_utils import custom_object_scope
from keras.utils.... | true | true |
1c106e91410abfabf50763dfa090dc1dea1181d0 | 304,143 | py | Python | src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | CarolineNB/azure-cli | a481115d3b8a575e24b61baeea854ad2cd668f31 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | CarolineNB/azure-cli | a481115d3b8a575e24b61baeea854ad2cd668f31 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | CarolineNB/azure-cli | a481115d3b8a575e24b61baeea854ad2cd668f31 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 53.414647 | 764 | 0.625781 |
import json
import os
import platform
import tempfile
import time
import unittest
import mock
import uuid
from azure.cli.testsdk.exceptions import JMESPathCheckAssertionError
from knack.util import CLIError
from azure_devtools.scenario_tests import AllowLargeResponse, record_only, live_only
from azure.cli.core.profil... | true | true |
1c107051ba50186f3333137cefe1593066fee118 | 3,337 | py | Python | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2017_04_01/aio/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2017_04_01/aio/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2017_04_01/aio/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.073529 | 173 | 0.704525 |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from .._version import VERSION
if TYPE_CHECKING:
from azure.core.credentials_async import AsyncTokenCredential
class S... | true | true |
1c1070be246ea21e6f70bc7c96233d56ba698a5a | 2,208 | py | Python | env/lib/python2.7/site-packages/pymongo/response.py | paithoa/Flask-Blog | 60ed23e6ef01267caf8e907ab721a061b98b39af | [
"MIT"
] | null | null | null | env/lib/python2.7/site-packages/pymongo/response.py | paithoa/Flask-Blog | 60ed23e6ef01267caf8e907ab721a061b98b39af | [
"MIT"
] | 2 | 2021-04-30T20:34:10.000Z | 2021-06-01T21:47:23.000Z | env/lib/python2.7/site-packages/pymongo/response.py | paithoa/Flask-Blog | 60ed23e6ef01267caf8e907ab721a061b98b39af | [
"MIT"
] | null | null | null | # Copyright 2014-2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 30.666667 | 76 | 0.644475 |
class Response(object):
__slots__ = ('_data', '_address')
def __init__(self, data, address):
self._data = data
self._address = address
@property
def data(self):
return self._data
@property
def address(self):
return self._address
class ExhaustResponse(Respo... | true | true |
1c10714512a905408a15c4f97dcea28d12746b76 | 4,714 | py | Python | test/test_basic.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | null | null | null | test/test_basic.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | null | null | null | test/test_basic.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | 1 | 2022-03-16T10:47:51.000Z | 2022-03-16T10:47:51.000Z | """Tests for quantization"""
import numpy as np
import unittest
import shutil
import os
import yaml
import tensorflow as tf
def build_fake_yaml():
fake_yaml = '''
model:
name: fake_yaml
framework: tensorflow
inputs: x
outputs: op2_to_store
devi... | 35.443609 | 124 | 0.590793 | import numpy as np
import unittest
import shutil
import os
import yaml
import tensorflow as tf
def build_fake_yaml():
fake_yaml = '''
model:
name: fake_yaml
framework: tensorflow
inputs: x
outputs: op2_to_store
device: cpu
evaluation:
... | true | true |
1c10736f0ac145ee5a666a17ab023731af97a9f2 | 7,380 | py | Python | mopidy/internal/path.py | ZenithDK/mopidy | aa3293673ae185c1a6de1d7f26561f09bc8ceb19 | [
"Apache-2.0"
] | null | null | null | mopidy/internal/path.py | ZenithDK/mopidy | aa3293673ae185c1a6de1d7f26561f09bc8ceb19 | [
"Apache-2.0"
] | null | null | null | mopidy/internal/path.py | ZenithDK/mopidy | aa3293673ae185c1a6de1d7f26561f09bc8ceb19 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import logging
import os
import stat
import string
import threading
from mopidy import compat, exceptions
from mopidy.compat import queue, urllib
from mopidy.internal import encoding, xdg
logger = logging.getLogger(__name__)
XDG_DIRS = xdg.get_dirs()
def ... | 30.75 | 79 | 0.638618 | from __future__ import absolute_import, unicode_literals
import logging
import os
import stat
import string
import threading
from mopidy import compat, exceptions
from mopidy.compat import queue, urllib
from mopidy.internal import encoding, xdg
logger = logging.getLogger(__name__)
XDG_DIRS = xdg.get_dirs()
def ... | true | true |
1c10739aa3a54606a9f49034d527b7fdcddc6ee7 | 4,689 | py | Python | tests/functional/run_functional_tests.py | check-spelling/terraform-compliance | 83636f0a0bad2e0e73eae70cf153c76f952cd2f3 | [
"MIT"
] | null | null | null | tests/functional/run_functional_tests.py | check-spelling/terraform-compliance | 83636f0a0bad2e0e73eae70cf153c76f952cd2f3 | [
"MIT"
] | null | null | null | tests/functional/run_functional_tests.py | check-spelling/terraform-compliance | 83636f0a0bad2e0e73eae70cf153c76f952cd2f3 | [
"MIT"
] | 2 | 2020-10-27T17:48:26.000Z | 2021-06-04T04:09:42.000Z | import os
import sys
import subprocess
import colorful
import re
class Config(object):
test_dir = 'tests/functional'
default_parameters = [
'--no-ansi'
]
print('Running functional tests in {}.'.format(Config.test_dir))
if len(sys.argv) == 2:
tests = [sys.argv[1]]
else:
tests = []
for... | 35.522727 | 123 | 0.519727 | import os
import sys
import subprocess
import colorful
import re
class Config(object):
test_dir = 'tests/functional'
default_parameters = [
'--no-ansi'
]
print('Running functional tests in {}.'.format(Config.test_dir))
if len(sys.argv) == 2:
tests = [sys.argv[1]]
else:
tests = []
for... | true | true |
1c1073bb6de59ff46c775e5b6066f957271cd4d9 | 23,327 | py | Python | midca/metamodules/interpret.py | COLAB2/midca | 18d6b13e3d6b0d980cd3453196e82fad7302e79b | [
"MIT"
] | 12 | 2018-01-23T01:31:33.000Z | 2022-02-03T04:47:10.000Z | midca/metamodules/interpret.py | COLAB2/midca | 18d6b13e3d6b0d980cd3453196e82fad7302e79b | [
"MIT"
] | 32 | 2017-11-02T20:58:03.000Z | 2021-04-15T18:59:27.000Z | midca/metamodules/interpret.py | COLAB2/midca | 18d6b13e3d6b0d980cd3453196e82fad7302e79b | [
"MIT"
] | 5 | 2017-12-01T17:28:01.000Z | 2020-03-18T14:43:32.000Z | from midca import base
import inspect
from midca.worldsim import domainread
class MentalExpectation:
'''
An expectation about a mental state (a mental state is a collection of variable bindings)
'''
def __init__(self):
self.vars_and_funcs = {}
def add_var_expectaiton(self, va... | 44.687739 | 133 | 0.52047 | from midca import base
import inspect
from midca.worldsim import domainread
class MentalExpectation:
def __init__(self):
self.vars_and_funcs = {}
def add_var_expectaiton(self, varname, func):
self.vars_and_funcs[varname] = func
def get_vars_and_funcs(self):
... | true | true |
1c1073ca3310432edfc6683a09209e58c7875de4 | 9,643 | py | Python | hubspot/events/api/events_api.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/events/api/events_api.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/events/api/events_api.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
HubSpot Events API
API for accessing CRM object events. # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import si... | 43.436937 | 204 | 0.603858 |
from __future__ import absolute_import
import re
import six
from hubspot.events.api_client import ApiClient
from hubspot.events.exceptions import ApiTypeError, ApiValueError
class EventsApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
... | true | true |
1c10741bd0eff9ca15f603c936da52b6486f9f13 | 5,552 | py | Python | inputscope/db.py | Python3pkg/InputScope | 10ec9ada2f05257a760054ca3c064fd7fa6c593a | [
"MIT"
] | 2 | 2020-03-04T10:39:05.000Z | 2020-04-12T16:25:48.000Z | inputscope/db.py | Python3pkg/InputScope | 10ec9ada2f05257a760054ca3c064fd7fa6c593a | [
"MIT"
] | null | null | null | inputscope/db.py | Python3pkg/InputScope | 10ec9ada2f05257a760054ca3c064fd7fa6c593a | [
"MIT"
] | 2 | 2020-04-12T16:29:47.000Z | 2020-05-24T13:41:52.000Z | # -*- coding: utf-8 -*-
"""
Simple convenience wrapper for SQLite. Example usage:
db.init(":memory:", ["CREATE TABLE test (id INTEGER PRIMARY KEY, val TEXT)"])
for i in range(5): db.insert("test", [("val", "venividivici")])
db.insert("test", val=None)
db.fetchone("test", val=None, limit=[0, 3])
db.update("test", value... | 38.555556 | 88 | 0.598343 | import os
import re
import sqlite3
def fetch(table, cols="*", where=(), group="", order=(), limit=(), **kwargs):
return select(table, cols, where, group, order, limit, **kwargs).fetchall()
def fetchone(table, cols="*", where=(), group="", order=(), limit=(), **kwargs):
return select(table, cols, where, grou... | true | true |
1c107428b8b1d3b4b620af07029244d2acf160c5 | 5,002 | py | Python | chainercv/transforms/image/random_sized_crop.py | souravsingh/chainercv | 8f76510472bc95018c183e72f37bc6c34a89969c | [
"MIT"
] | 1,600 | 2017-06-01T15:37:52.000Z | 2022-03-09T08:39:09.000Z | chainercv/transforms/image/random_sized_crop.py | souravsingh/chainercv | 8f76510472bc95018c183e72f37bc6c34a89969c | [
"MIT"
] | 547 | 2017-06-01T06:43:16.000Z | 2021-05-28T17:14:05.000Z | chainercv/transforms/image/random_sized_crop.py | souravsingh/chainercv | 8f76510472bc95018c183e72f37bc6c34a89969c | [
"MIT"
] | 376 | 2017-06-02T01:29:10.000Z | 2022-03-13T11:19:59.000Z | from __future__ import division
import math
import numpy as np
import random
def random_sized_crop(img,
scale_ratio_range=(0.08, 1),
aspect_ratio_range=(3 / 4, 4 / 3),
return_param=False, copy=False):
"""Crop an image to random size and aspect rat... | 39.385827 | 79 | 0.605358 | from __future__ import division
import math
import numpy as np
import random
def random_sized_crop(img,
scale_ratio_range=(0.08, 1),
aspect_ratio_range=(3 / 4, 4 / 3),
return_param=False, copy=False):
_, H, W = img.shape
scale_ratio, aspect_ra... | true | true |
1c107464219113a0cbadeb8569a17c60d5b05d71 | 2,049 | py | Python | lru_cache.py | anjishnu/micro-LRU | f6df8c1af6fbbc5d9a84d5bab13282be391709e5 | [
"MIT"
] | 1 | 2016-11-02T01:33:15.000Z | 2016-11-02T01:33:15.000Z | lru_cache.py | anjishnu/micro-LRU | f6df8c1af6fbbc5d9a84d5bab13282be391709e5 | [
"MIT"
] | null | null | null | lru_cache.py | anjishnu/micro-LRU | f6df8c1af6fbbc5d9a84d5bab13282be391709e5 | [
"MIT"
] | null | null | null | ''' Minimal implementation of an LRU cache which implements addition, deletion and retrieval in O(1)'''
class Node(object):
def __init__(self, key, value):
''' A node in a doubly linked list '''
self.key = key
self.value = value
self.next = None
self.prev = None
cla... | 30.58209 | 103 | 0.545632 | class Node(object):
def __init__(self, key, value):
self.key = key
self.value = value
self.next = None
self.prev = None
class LRU(object):
def __init__(self, capacity=1000):
self.capacity = capacity
self.cache = {}
self.start_node = None
... | true | true |
1c107475a8691d6dadae731f6ce277df75030eb6 | 21,960 | py | Python | src/sentry/conf/server.py | llonchj/sentry | b892b30538f0e0d5451dbe6af1df9aace7229c69 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/conf/server.py | llonchj/sentry | b892b30538f0e0d5451dbe6af1df9aace7229c69 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/conf/server.py | llonchj/sentry | b892b30538f0e0d5451dbe6af1df9aace7229c69 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.conf.server
~~~~~~~~~~~~~~~~~~
These settings act as the default (base) settings for the Sentry-provided web-server
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.conf.global_se... | 28.781127 | 113 | 0.683652 | from __future__ import absolute_import
from django.conf.global_settings import *
from datetime import timedelta
import hashlib
import os
import os.path
import socket
import sys
import tempfile
import urlparse
gettext_noop = lambda s: s
socket.setdefaulttimeout(5)
DEBUG = False
TEMPLATE_DEBUG = True
MAINTENANCE =... | true | true |
1c10774724174936ebd2ee74aa36a5b8149efdd8 | 2,010 | py | Python | tests/console/match_command_test.py | pmav99/prx | 5152cd20cf731b597693cb25d057bd95e48da5aa | [
"MIT"
] | null | null | null | tests/console/match_command_test.py | pmav99/prx | 5152cd20cf731b597693cb25d057bd95e48da5aa | [
"MIT"
] | null | null | null | tests/console/match_command_test.py | pmav99/prx | 5152cd20cf731b597693cb25d057bd95e48da5aa | [
"MIT"
] | null | null | null | import io
import os
from cleo import Application
from cleo import CommandTester
import pytest
from prx.console.match_command import MatchCommand
def cleo_tester(command_class, command_name):
app = Application()
app.add(command_class())
cmd = app.find(command_name)
tester = CommandTester(cmd)
ret... | 33.5 | 82 | 0.590547 | import io
import os
from cleo import Application
from cleo import CommandTester
import pytest
from prx.console.match_command import MatchCommand
def cleo_tester(command_class, command_name):
app = Application()
app.add(command_class())
cmd = app.find(command_name)
tester = CommandTester(cmd)
ret... | true | true |
1c1077b05f9163a876d9fd59ca0f98544ab27204 | 3,569 | py | Python | Pyrado/pyrado/tasks/condition_only.py | jacarvalho/SimuRLacra | a6c982862e2ab39a9f65d1c09aa59d9a8b7ac6c5 | [
"BSD-3-Clause"
] | null | null | null | Pyrado/pyrado/tasks/condition_only.py | jacarvalho/SimuRLacra | a6c982862e2ab39a9f65d1c09aa59d9a8b7ac6c5 | [
"BSD-3-Clause"
] | null | null | null | Pyrado/pyrado/tasks/condition_only.py | jacarvalho/SimuRLacra | a6c982862e2ab39a9f65d1c09aa59d9a8b7ac6c5 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from typing import Callable
import pyrado
from pyrado.utils.data_types import EnvSpec
from pyrado.tasks.base import Task
from pyrado.tasks.reward_functions import RewFcn, ZeroPerStepRewFcn
class ConditionOnlyTask(Task):
"""
Task class which yields zero reward at every time and terminates i... | 37.968085 | 120 | 0.644438 | import numpy as np
from typing import Callable
import pyrado
from pyrado.utils.data_types import EnvSpec
from pyrado.tasks.base import Task
from pyrado.tasks.reward_functions import RewFcn, ZeroPerStepRewFcn
class ConditionOnlyTask(Task):
def __init__(self,
env_spec: EnvSpec,
c... | true | true |
1c107915969282106a1424a582c2f57ff57f3b68 | 2,570 | py | Python | Integrator/ar2dtool.py | nvbach91/OnToology | c136db35b5d97d75fa3538cac429f149e162a2e3 | [
"Apache-2.0"
] | null | null | null | Integrator/ar2dtool.py | nvbach91/OnToology | c136db35b5d97d75fa3538cac429f149e162a2e3 | [
"Apache-2.0"
] | null | null | null | Integrator/ar2dtool.py | nvbach91/OnToology | c136db35b5d97d75fa3538cac429f149e162a2e3 | [
"Apache-2.0"
] | null | null | null | import os
from subprocess import call
from Integrator import dolog, get_file_from_path, build_path, delete_dir
from Integrator import get_parent_path, log_file_dir, config_folder_name
from . import call_and_get_log, timeout_comm
import sys
ar2dtool_config_types = ['ar2dtool-taxonomy.conf', 'ar2dtool-class.conf']
f... | 36.197183 | 112 | 0.653696 | import os
from subprocess import call
from Integrator import dolog, get_file_from_path, build_path, delete_dir
from Integrator import get_parent_path, log_file_dir, config_folder_name
from . import call_and_get_log, timeout_comm
import sys
ar2dtool_config_types = ['ar2dtool-taxonomy.conf', 'ar2dtool-class.conf']
f... | true | true |
1c107a12758455b1ec838cafb936970ebe117f34 | 1,236 | py | Python | win/main.py | HoolyPanda/Tat-Ru_Translater | 09a09e0eba745710a1165716005c9156a95dbccf | [
"MIT"
] | null | null | null | win/main.py | HoolyPanda/Tat-Ru_Translater | 09a09e0eba745710a1165716005c9156a95dbccf | [
"MIT"
] | null | null | null | win/main.py | HoolyPanda/Tat-Ru_Translater | 09a09e0eba745710a1165716005c9156a95dbccf | [
"MIT"
] | null | null | null | # from xlrd import open_workbook
import sys
import translater
import client
import os
# from os import path
s = translater.Translater()
def MainMenu():
# print()
# print(os.getlogin())
a = os.getlogin()
if len(sys.argv) == 2:
# os.path.exists()
if os.path.exists(sys.argv... | 25.22449 | 72 | 0.508091 | import sys
import translater
import client
import os
s = translater.Translater()
def MainMenu():
a = os.getlogin()
if len(sys.argv) == 2:
if os.path.exists(sys.argv[1]):
pass
else:
procText = input("Введите текст на Русском или путь к ... | true | true |
1c107a83366115021a900ebd2e6e77cb3d424467 | 531 | py | Python | takeoff/tests/generator_test.py | themarceloribeiro/takeoff-py | dfa4c58ccd9146f82ffe4d5f76aa2a258d3c0d7c | [
"MIT"
] | null | null | null | takeoff/tests/generator_test.py | themarceloribeiro/takeoff-py | dfa4c58ccd9146f82ffe4d5f76aa2a258d3c0d7c | [
"MIT"
] | null | null | null | takeoff/tests/generator_test.py | themarceloribeiro/takeoff-py | dfa4c58ccd9146f82ffe4d5f76aa2a258d3c0d7c | [
"MIT"
] | null | null | null | from unittest import TestCase
from takeoff import *
class GeneratorTest(TestCase):
def setUp(self):
self.g = Generator(['web:project', 'blog'])
def test_load_type_subtype(self):
self.assertEqual(self.g.generator_type, 'web')
self.assertEqual(self.g.generator_subtype, 'project')
... | 29.5 | 79 | 0.676083 | from unittest import TestCase
from takeoff import *
class GeneratorTest(TestCase):
def setUp(self):
self.g = Generator(['web:project', 'blog'])
def test_load_type_subtype(self):
self.assertEqual(self.g.generator_type, 'web')
self.assertEqual(self.g.generator_subtype, 'project')
... | true | true |
1c107b7efbab101fc4e723dbd4df7c76b903fc11 | 55 | py | Python | pyxb/utils/__init__.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | pyxb/utils/__init__.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | pyxb/utils/__init__.py | thorstenb/pyxb | 634e86f61dfb73a2900f32fc3d819e9c25365a49 | [
"Apache-2.0"
] | null | null | null | """pyxb.utils -- Utilities for the PyWXSB package.
"""
| 18.333333 | 50 | 0.672727 | true | true | |
1c107be2f510bf68ad5d0787695309bc2c709626 | 2,194 | py | Python | retinanet/materials/lit_data_loader.py | Willianwatch/ObjectDetectionPL | 58b13dc107248f3d6c268fc76b216671a917520b | [
"MIT"
] | 2 | 2022-01-05T13:53:13.000Z | 2022-02-28T14:01:41.000Z | retinanet/materials/lit_data_loader.py | Willianwatch/ObjectDetectionPL | 58b13dc107248f3d6c268fc76b216671a917520b | [
"MIT"
] | null | null | null | retinanet/materials/lit_data_loader.py | Willianwatch/ObjectDetectionPL | 58b13dc107248f3d6c268fc76b216671a917520b | [
"MIT"
] | null | null | null | from typing import Optional
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from retinanet.experiments.dataset_configs import CocoConfigs, CSVConfigs
from retinanet.materials.datasets.coco_dataset import CocoDataset
from retinanet.materials.datasets.csv_dataset import CSVDataset
from retinanet.... | 48.755556 | 113 | 0.693254 | from typing import Optional
from torch.utils.data import DataLoader
import pytorch_lightning as pl
from retinanet.experiments.dataset_configs import CocoConfigs, CSVConfigs
from retinanet.materials.datasets.coco_dataset import CocoDataset
from retinanet.materials.datasets.csv_dataset import CSVDataset
from retinanet.... | true | true |
1c107c3a6d0ee5f5fb18049fa921900dd7fad6a4 | 5,509 | py | Python | salvia/simulator/full_node_simulator.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 6 | 2021-09-13T17:20:49.000Z | 2022-02-09T04:31:47.000Z | salvia/simulator/full_node_simulator.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 21 | 2021-09-20T00:56:54.000Z | 2022-03-22T01:12:12.000Z | salvia/simulator/full_node_simulator.py | mikando/salvia-blockchain | 02181d0b5a063374f01eea951570dbc661bddc34 | [
"Apache-2.0"
] | 9 | 2021-09-13T17:54:04.000Z | 2022-03-15T08:38:35.000Z | from typing import List, Optional
from salvia.consensus.block_record import BlockRecord
from salvia.full_node.full_node_api import FullNodeAPI
from salvia.protocols.full_node_protocol import RespondBlock
from salvia.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol
from salvia.types.full_block im... | 41.11194 | 110 | 0.642403 | from typing import List, Optional
from salvia.consensus.block_record import BlockRecord
from salvia.full_node.full_node_api import FullNodeAPI
from salvia.protocols.full_node_protocol import RespondBlock
from salvia.simulator.simulator_protocol import FarmNewBlockProtocol, ReorgProtocol
from salvia.types.full_block im... | true | true |
1c107c47bfb32ca1fc6fb1c241a19db62f825626 | 5,178 | py | Python | tenable/io/assets.py | nicobbg/pyTenable | c6e3aa00cbe749eb425c4b8fada7b4349276364a | [
"MIT"
] | null | null | null | tenable/io/assets.py | nicobbg/pyTenable | c6e3aa00cbe749eb425c4b8fada7b4349276364a | [
"MIT"
] | null | null | null | tenable/io/assets.py | nicobbg/pyTenable | c6e3aa00cbe749eb425c4b8fada7b4349276364a | [
"MIT"
] | null | null | null | '''
assets
======
The following methods allow for interaction into the Tenable.io
:devportal:`assets <assets>` API endpoints.
Methods available on ``tio.assets``:
.. rst-class:: hide-signature
.. autoclass:: AssetsAPI
.. automethod:: asset_import
.. automethod:: delete
.. automethod:: details
.. aut... | 28.450549 | 80 | 0.529741 | from .base import TIOEndpoint
class AssetsAPI(TIOEndpoint):
def list(self):
return self._api.get('assets').json()['assets']
def delete(self, uuid):
self._api.delete('workbenches/assets/{}'.format(
self._check('uuid', uuid, 'uuid')))
def details(self, uuid):
return self... | true | true |
1c107f33c2362870e08a5342d91a5a73124816c2 | 2,989 | py | Python | pygments/__init__.py | psaris/pygments | cbcbffea1b1f8edf4b824edadbb181f5143ce9ab | [
"BSD-2-Clause"
] | null | null | null | pygments/__init__.py | psaris/pygments | cbcbffea1b1f8edf4b824edadbb181f5143ce9ab | [
"BSD-2-Clause"
] | null | null | null | pygments/__init__.py | psaris/pygments | cbcbffea1b1f8edf4b824edadbb181f5143ce9ab | [
"BSD-2-Clause"
] | null | null | null | """
Pygments
~~~~~~~~
Pygments is a syntax highlighting package written in Python.
It is a generic syntax highlighter for general use in all kinds of software
such as forum systems, wikis or other applications that need to prettify
source code. Highlights are:
* a wide range of common lan... | 36.012048 | 90 | 0.659752 | from io import StringIO, BytesIO
__version__ = '2.12.0'
__docformat__ = 'restructuredtext'
__all__ = ['lex', 'format', 'highlight']
def lex(code, lexer):
try:
return lexer.get_tokens(code)
except TypeError as err:
from pygments.lexer import RegexLexer
if isinstance(lexer, typ... | true | true |
1c107f8e5734481b18e5c71b0ca64326be0e64d4 | 4,867 | py | Python | openclean/embedding/base.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 4 | 2021-04-20T09:06:26.000Z | 2021-11-20T20:31:28.000Z | openclean/embedding/base.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 14 | 2021-01-19T19:23:16.000Z | 2021-04-28T14:31:03.000Z | openclean/embedding/base.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 5 | 2021-08-24T11:57:21.000Z | 2022-03-17T04:39:04.000Z | # This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Operator that creates feature vectors (embeddings) for a list of values.
Embeddings are generated by a ... | 32.885135 | 79 | 0.638586 |
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
import numpy as np
from openclean.data.sequence import Sequence
def embedding(df, columns, features):
op = Embedding(features=features)
return op.exec(values=Sequence(df=df, columns=columns))
class FeatureVector(OrderedDict):
... | true | true |
1c10803a76e37de0b2d0a60ee79145b9543b0dce | 146 | py | Python | qsy/__init__.py | soudy/qsy | 928d40d735f76fe81f39e90f7cb3c6154d366690 | [
"MIT"
] | 26 | 2019-05-02T13:15:09.000Z | 2022-01-21T23:35:46.000Z | qsy/__init__.py | soudy/qsy | 928d40d735f76fe81f39e90f7cb3c6154d366690 | [
"MIT"
] | 1 | 2019-05-02T13:46:15.000Z | 2019-05-02T22:30:51.000Z | qsy/__init__.py | soudy/qsy | 928d40d735f76fe81f39e90f7cb3c6154d366690 | [
"MIT"
] | 1 | 2019-05-26T03:43:52.000Z | 2019-05-26T03:43:52.000Z | from .quantum_register import QuantumRegister
from .classical_register import ClassicalRegister
import qsy.gates as gates
__version__ = '0.4.4'
| 20.857143 | 49 | 0.828767 | from .quantum_register import QuantumRegister
from .classical_register import ClassicalRegister
import qsy.gates as gates
__version__ = '0.4.4'
| true | true |
1c108060f56e19bce198f30a1527052ecdf6d52a | 3,540 | py | Python | cbbc/qapackage/HotpotProcessor.py | Robert-xiaoqiang/Model-Capability-Assessment | 3cb8673ea66bfeded9d6421e15b288b485ccc53b | [
"Unlicense"
] | null | null | null | cbbc/qapackage/HotpotProcessor.py | Robert-xiaoqiang/Model-Capability-Assessment | 3cb8673ea66bfeded9d6421e15b288b485ccc53b | [
"Unlicense"
] | null | null | null | cbbc/qapackage/HotpotProcessor.py | Robert-xiaoqiang/Model-Capability-Assessment | 3cb8673ea66bfeded9d6421e15b288b485ccc53b | [
"Unlicense"
] | null | null | null | import json
import os
from functools import partial
from multiprocessing import Pool, cpu_count
from enum import Enum
import torch
from torch import nn
from torch.nn import init
from torch.nn import functional as F
from torch.utils.data import TensorDataset
import numpy as np
from tqdm import tqdm
from .SquadProcesso... | 35.757576 | 105 | 0.567232 | import json
import os
from functools import partial
from multiprocessing import Pool, cpu_count
from enum import Enum
import torch
from torch import nn
from torch.nn import init
from torch.nn import functional as F
from torch.utils.data import TensorDataset
import numpy as np
from tqdm import tqdm
from .SquadProcesso... | true | true |
1c10809727b53ce5ede61c990557a085ad4013e7 | 2,241 | py | Python | config/settings/local.py | apirobot/django-linprog-solver-website | a90018c257b1d0a4c064baea1bb7c6e22bac1ab9 | [
"MIT"
] | 2 | 2017-04-22T11:25:00.000Z | 2020-04-05T20:22:41.000Z | config/settings/local.py | apirobot/django-linprog-solver-website | a90018c257b1d0a4c064baea1bb7c6e22bac1ab9 | [
"MIT"
] | null | null | null | config/settings/local.py | apirobot/django-linprog-solver-website | a90018c257b1d0a4c064baea1bb7c6e22bac1ab9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
import socket
import os
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool... | 29.88 | 99 | 0.493083 |
import socket
import os
from .base import *
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
SECRET_KEY = env('DJANGO_SECRET_KEY', default=':C<!QZ)W9<_2|3)Fz}ub~BDo5&w|dbJNM6l>N;#}]ZrJEg<i-r')
EMAIL_PORT = 1025
EMAIL_HOST = 'localhost'
EMAIL_BACKEND = env('DJANGO_EMAIL_BACK... | true | true |
1c10812b6c66d767a3f929d02dfbae1309898547 | 3,685 | py | Python | friendly_traceback/runtime_errors/index_error.py | alexmojaki/friendly-traceback | 16047808e6aaa00deb9e07a414bed944b01a32ac | [
"MIT"
] | null | null | null | friendly_traceback/runtime_errors/index_error.py | alexmojaki/friendly-traceback | 16047808e6aaa00deb9e07a414bed944b01a32ac | [
"MIT"
] | null | null | null | friendly_traceback/runtime_errors/index_error.py | alexmojaki/friendly-traceback | 16047808e6aaa00deb9e07a414bed944b01a32ac | [
"MIT"
] | null | null | null | """Getting specific information for IndexError"""
import ast
import re
import pure_eval
from .. import debug_helper
from .. import info_variables
from ..ft_gettext import current_lang, no_information, internal_error
def get_cause(value, frame, tb_data):
try:
return _get_cause(value, frame, tb_data)
... | 34.439252 | 92 | 0.615468 |
import ast
import re
import pure_eval
from .. import debug_helper
from .. import info_variables
from ..ft_gettext import current_lang, no_information, internal_error
def get_cause(value, frame, tb_data):
try:
return _get_cause(value, frame, tb_data)
except Exception as e: debug_helper.log_... | true | true |
1c1081faf35103aaf151f1fcb9c0da62388a1776 | 8,410 | py | Python | setup.py | gabrielelanaro/ezpipe | 669f4c48f4268c6104a5546569afa6dad2c7a24c | [
"MIT"
] | null | null | null | setup.py | gabrielelanaro/ezpipe | 669f4c48f4268c6104a5546569afa6dad2c7a24c | [
"MIT"
] | null | null | null | setup.py | gabrielelanaro/ezpipe | 669f4c48f4268c6104a5546569afa6dad2c7a24c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import imp
import subprocess
## Python 2.6 subprocess.check_output compatibility. Thanks Greg Hewgill!
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
proc = subprocess.Popen(
... | 30.919118 | 113 | 0.674911 | from __future__ import print_function
import os
import sys
import imp
import subprocess
if 'check_output' not in dir(subprocess):
def check_output(cmd_args, *args, **kwargs):
proc = subprocess.Popen(
cmd_args, *args,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
... | true | true |
1c108312350933a9e8fc6855d6e4226e630c6891 | 14,820 | py | Python | test/algorithms/pes_samplers/test_extrapolators.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 132 | 2021-01-28T14:51:11.000Z | 2022-03-25T21:10:47.000Z | test/algorithms/pes_samplers/test_extrapolators.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 449 | 2021-01-28T19:57:43.000Z | 2022-03-31T17:01:50.000Z | test/algorithms/pes_samplers/test_extrapolators.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 109 | 2021-01-28T13:17:46.000Z | 2022-03-30T23:53:39.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 37.709924 | 100 | 0.64305 |
import unittest
from test import QiskitNatureTestCase
from sklearn import linear_model
from qiskit_nature.exceptions import QiskitNatureError
from qiskit_nature.algorithms.pes_samplers import (
Extrapolator,
WindowExtrapolator,
PolynomialExtrapolator,
DifferentialExtrapolator,
PCAExtrapolator,
... | true | true |
1c108320463f0ca0d24d165864ebd90da29c9fc2 | 2,496 | py | Python | qiskit/aqua/utils/qp_solver.py | georgesbarron/qiskit-aqua | b38ca9893c5f9509693a2de48680781bed300987 | [
"Apache-2.0"
] | 1 | 2019-10-12T16:20:25.000Z | 2019-10-12T16:20:25.000Z | qiskit/aqua/utils/qp_solver.py | georgesbarron/qiskit-aqua | b38ca9893c5f9509693a2de48680781bed300987 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/utils/qp_solver.py | georgesbarron/qiskit-aqua | b38ca9893c5f9509693a2de48680781bed300987 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 31.2 | 91 | 0.626603 |
from typing import Optional, Tuple
import logging
import numpy as np
import cvxpy
logger = logging.getLogger(__name__)
def optimize_svm(kernel_matrix: np.ndarray,
y: np.ndarray,
scaling: Optional[float] = None,
max_iters: int = 500,
show_progres... | true | true |
1c1084651c7a92ae828a4972702ad1247d4c80e6 | 64 | py | Python | python/testData/mover/sameLevelInIf.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/mover/sameLevelInIf.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/mover/sameLevelInIf.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | if True:
a = 1
else:
#comment
a =<caret> 3
a = 2 | 10.666667 | 16 | 0.4375 | if True:
a = 1
else:
a =<caret> 3
a = 2 | false | true |
1c1084b71ffe5bfd47c5303de23c4afeb42bf995 | 3,659 | py | Python | tests/test_api_product.py | rlclaro/zebrands-restful-apis | 03340a0edb2561d4de345ebcbaec6d6c0e542ec4 | [
"MIT"
] | null | null | null | tests/test_api_product.py | rlclaro/zebrands-restful-apis | 03340a0edb2561d4de345ebcbaec6d6c0e542ec4 | [
"MIT"
] | null | null | null | tests/test_api_product.py | rlclaro/zebrands-restful-apis | 03340a0edb2561d4de345ebcbaec6d6c0e542ec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import json
import uuid
import requests
from catalog.model.product import Product, ProductSchema
def test_get_products():
"""
Test for get_products
:return:
"""
try:
products = requests.get('http://127.0.0.1:5000/products')
assert products... | 36.959596 | 117 | 0.576387 |
import datetime
import json
import uuid
import requests
from catalog.model.product import Product, ProductSchema
def test_get_products():
try:
products = requests.get('http://127.0.0.1:5000/products')
assert products.status_code == 200
except Exception as e:
print(e)
assert F... | true | true |
1c1084d772e3fe66d4f12528d995328a593ce1ac | 203 | py | Python | xenonpy/inverse/__init__.py | aya-miyazaki/XenonPy | 90971cc362402715ba15c63f5d75070f9680fd78 | [
"BSD-3-Clause"
] | 1 | 2021-10-08T06:30:06.000Z | 2021-10-08T06:30:06.000Z | xenonpy/inverse/__init__.py | aya-miyazaki/XenonPy | 90971cc362402715ba15c63f5d75070f9680fd78 | [
"BSD-3-Clause"
] | null | null | null | xenonpy/inverse/__init__.py | aya-miyazaki/XenonPy | 90971cc362402715ba15c63f5d75070f9680fd78 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019. yoshida-lab. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
__all__ = ['iqspr']
from . import iqspr
| 25.375 | 56 | 0.714286 |
__all__ = ['iqspr']
from . import iqspr
| true | true |
1c1085f929e8ffbdbe3c5674285afb9dbcdb232d | 525 | py | Python | amigo/views/__init__.py | ada0l/amigo | 83e0250718cddf4c9f2ed1a751837483221ffbae | [
"MIT"
] | null | null | null | amigo/views/__init__.py | ada0l/amigo | 83e0250718cddf4c9f2ed1a751837483221ffbae | [
"MIT"
] | null | null | null | amigo/views/__init__.py | ada0l/amigo | 83e0250718cddf4c9f2ed1a751837483221ffbae | [
"MIT"
] | null | null | null | from amigo.views.edit import EditView
from amigo.views.help import HelpView
from amigo.views.join import JoinView
from amigo.views.send import SendView
from amigo.views.set_text import TextView
from amigo.views.start import StartView
from amigo.views.status import StatusView
from amigo.views.stop import StopView
from a... | 23.863636 | 45 | 0.746667 | from amigo.views.edit import EditView
from amigo.views.help import HelpView
from amigo.views.join import JoinView
from amigo.views.send import SendView
from amigo.views.set_text import TextView
from amigo.views.start import StartView
from amigo.views.status import StatusView
from amigo.views.stop import StopView
from a... | true | true |
1c108658808fac925cf2f9a040838a31deb72941 | 2,359 | py | Python | build/lib/GPyM/get_path.py | palexandremello/GPyM | 10daa25e4d68d527c799f6bf99225b4992e43319 | [
"MIT"
] | 1 | 2021-03-08T15:47:52.000Z | 2021-03-08T15:47:52.000Z | build/lib/GPyM/get_path.py | palexandremello/GPyM | 10daa25e4d68d527c799f6bf99225b4992e43319 | [
"MIT"
] | 1 | 2019-01-08T17:56:27.000Z | 2019-01-08T17:56:27.000Z | build/lib/GPyM/get_path.py | palexandremello/GPyM | 10daa25e4d68d527c799f6bf99225b4992e43319 | [
"MIT"
] | null | null | null | #! /usr/bin/python
# --------------------------------------------------------------------
# PROGRAM : get_path.py
# CREATED BY : hjkim @IIS.2015-07-13 13:02:05.942756
# MODIFED BY :
#
# USAGE : $ ./get_path.py
#
# DESCRIPTION:
# ------------------------------------------------------cf0.2@20120401
import os
im... | 26.505618 | 76 | 0.538364 |
import os
import sys
from optparse import OptionParser
from parse_fname_trmm import parse_fname_trmm
from parse_fname_gpm import parse_fname_gpm
def get_path(srcDir, sDTime, eDTime):
prjName, prdLv, prdVer = srcDir.split(os.path.sep)[-3:]
parse_fname = {'TRMM': parse_fname_trmm,
'GPM':... | true | true |
1c1087825b5debcc6a33bbb27b4d6580bfa6a29d | 520 | py | Python | webapp/controllers/contact.py | OpenTreeOfLife/opentree | d2789fac3b23e1609c50e4e14785379752c295db | [
"BSD-2-Clause"
] | 99 | 2015-01-17T16:00:23.000Z | 2022-03-10T23:56:32.000Z | webapp/controllers/contact.py | OpenTreeOfLife/opentree | d2789fac3b23e1609c50e4e14785379752c295db | [
"BSD-2-Clause"
] | 680 | 2015-01-01T03:27:54.000Z | 2022-01-18T18:54:14.000Z | webapp/controllers/contact.py | OpenTreeOfLife/opentree | d2789fac3b23e1609c50e4e14785379752c295db | [
"BSD-2-Clause"
] | 18 | 2015-06-14T08:27:11.000Z | 2021-09-29T02:32:50.000Z | # -*- coding: utf-8 -*-
from opentreewebapputil import (get_opentree_services_method_urls,
fetch_current_TNRS_context_names)
### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requir... | 30.588235 | 88 | 0.742308 | from opentreewebapputil import (get_opentree_services_method_urls,
fetch_current_TNRS_context_names)
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
default_view_dict = get_opentree_services_method_urls(request)
de... | true | true |
1c1088281755f081fa1bc455252366bc1549f330 | 1,663 | py | Python | samples/DrawParametricCurve.py | arnaudjuracek/rhino-scripts | e33cece9a8b1155095bf70a96de6fb39d71481f8 | [
"MIT"
] | 1 | 2021-03-23T21:32:21.000Z | 2021-03-23T21:32:21.000Z | samples/DrawParametricCurve.py | arnaudjuracek/rhino-scripts | e33cece9a8b1155095bf70a96de6fb39d71481f8 | [
"MIT"
] | null | null | null | samples/DrawParametricCurve.py | arnaudjuracek/rhino-scripts | e33cece9a8b1155095bf70a96de6fb39d71481f8 | [
"MIT"
] | null | null | null | import rhinoscriptsyntax as rs
import math
# Something really interesting about this script is
# that we are passing a function as a parameter
def DrawParametricCurve(parametric_equation):
"Create a interpolated curve based on a parametric equation."
# Get the minimum parameter
t0 = rs.GetReal("Minimum t v... | 31.377358 | 74 | 0.647625 | import rhinoscriptsyntax as rs
import math
def DrawParametricCurve(parametric_equation):
t0 = rs.GetReal("Minimum t value", 0.0)
if( t0==None ): return
t1 = rs.GetReal("Maximum t value", 1.0)
if( t1==None ): return
count = rs.GetInteger("Number of points", 50, 2)
if count<1: r... | true | true |
1c1088b8a933afae7248fe82c026deb64391df75 | 12,201 | py | Python | usr/local/lib/python3.6/dist-packages/github/GitRelease.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | null | null | null | usr/local/lib/python3.6/dist-packages/github/GitRelease.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | 18 | 2019-10-10T00:08:35.000Z | 2019-10-23T15:34:42.000Z | core/layers/uigen/python/github/GitRelease.py | nerdguru/sls-pypi | b31c7738ac3bada5ecf3eaae8dcbc2d2a30b7dcf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2015 Ed Holland <eholland@alertlogic.com> #
# Copyright 2016 Benjamin Whitney <benjamin.whitney@... | 39.742671 | 164 | 0.577985 |
from os.path import basename
import github.GithubObject
import github.NamedUser
import github.GitReleaseAsset
class GitRelease(github.GithubObject.CompletableGithubObject):
def __repr__(self):
return self.get__repr__({"title": self._title.value})
@property
def id(self):
self._completeI... | true | true |
1c10899744e22ad2acfc46d72ed8e3c83671cacc | 36,836 | py | Python | game/util.py | ProgrammingGym/tetris_game_pygame | 7e8e895af446d627e50b4035882f5cb1d42bc8ca | [
"MIT"
] | null | null | null | game/util.py | ProgrammingGym/tetris_game_pygame | 7e8e895af446d627e50b4035882f5cb1d42bc8ca | [
"MIT"
] | null | null | null | game/util.py | ProgrammingGym/tetris_game_pygame | 7e8e895af446d627e50b4035882f5cb1d42bc8ca | [
"MIT"
] | null | null | null |
import pygame
import sys
import random
import time
# Defining important global variables:-
##########################################################
pygame.init()
clock = pygame.time.Clock()
best_score = 0
longest_time = 0
width = 700
height = 750
DISPLAY_SCREEN = pygame.display.set_mode((width, height))
pygame.di... | 48.026076 | 185 | 0.595559 |
import pygame
import sys
import random
import time
pygame.init()
clock = pygame.time.Clock()
best_score = 0
longest_time = 0
width = 700
height = 750
DISPLAY_SCREEN = pygame.display.set_mode((width, height))
pygame.display.set_caption(" Tetris")
off_set_x = 10
off_set_y = 80
playing_field_width = 330 playing_fiel... | true | true |
1c108b9ebc5cf8b02a951115ae4d2a33b465c5ff | 23,911 | py | Python | uf/model/fastbert.py | dumpmemory/unif | a301d7207791664fb107edda607c55f2d50dd17d | [
"Apache-2.0"
] | null | null | null | uf/model/fastbert.py | dumpmemory/unif | a301d7207791664fb107edda607c55f2d50dd17d | [
"Apache-2.0"
] | null | null | null | uf/model/fastbert.py | dumpmemory/unif | a301d7207791664fb107edda607c55f2d50dd17d | [
"Apache-2.0"
] | null | null | null | """ FastBERT, self-distilled BERT with dynamic inference.
Code revised from Google's implementation of BERT.
See `https://github.com/google-research/bert`.
"""
import copy
import collections
from ..third import tf
from .bert import BERTEncoder
from .base import BaseDecoder
from . import util
class FastBERTClsDi... | 44.861163 | 79 | 0.496968 |
import copy
import collections
from ..third import tf
from .bert import BERTEncoder
from .base import BaseDecoder
from . import util
class FastBERTClsDistillor(BaseDecoder, BERTEncoder):
def __init__(self,
bert_config,
is_training,
input_ids,
i... | true | true |
1c108c87ade1d2eff241f075b90cd98bd4f644bf | 461 | py | Python | .venv/lib/python2.7/site-packages/celery/__main__.py | MansoorHanif/FYP-web-app | 918008d3b5eedaa904f3e720296afde9d73ac3f4 | [
"BSD-3-Clause"
] | 4 | 2018-10-19T04:36:20.000Z | 2020-02-13T16:14:09.000Z | .venv/lib/python2.7/site-packages/celery/__main__.py | MansoorHanif/FYP-web-app | 918008d3b5eedaa904f3e720296afde9d73ac3f4 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T23:03:45.000Z | 2021-06-10T18:05:11.000Z | oo/lib/python3.5/site-packages/celery/__main__.py | chunky2808/SPOJ-history-Django-App | 490c58b1593cd3626f0ddc27fdd09c6e8d1c56e1 | [
"MIT"
] | 1 | 2019-10-26T04:20:52.000Z | 2019-10-26T04:20:52.000Z | """Entry-point for the :program:`celery` umbrella command."""
from __future__ import absolute_import, print_function, unicode_literals
import sys
from . import maybe_patch_concurrency
__all__ = ['main']
def main():
"""Entrypoint to the ``celery`` umbrella command."""
if 'multi' not in sys.argv:
maybe... | 24.263158 | 72 | 0.700651 | from __future__ import absolute_import, print_function, unicode_literals
import sys
from . import maybe_patch_concurrency
__all__ = ['main']
def main():
if 'multi' not in sys.argv:
maybe_patch_concurrency()
from celery.bin.celery import main as _main
_main()
if __name__ == '__main__': main... | true | true |
1c108cb528e80e3926d882403444c332dce74b01 | 8,448 | py | Python | t5/models/mesh_transformer_main.py | smit2k14/text-to-text-transfer-transformer | 2a3bed10cb36120a3899acd70ee987a4369701bb | [
"Apache-2.0"
] | 1 | 2020-04-24T11:29:29.000Z | 2020-04-24T11:29:29.000Z | t5/models/mesh_transformer_main.py | smit2k14/text-to-text-transfer-transformer | 2a3bed10cb36120a3899acd70ee987a4369701bb | [
"Apache-2.0"
] | null | null | null | t5/models/mesh_transformer_main.py | smit2k14/text-to-text-transfer-transformer | 2a3bed10cb36120a3899acd70ee987a4369701bb | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The T5 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 applicable law or agreed to in writi... | 36.257511 | 83 | 0.686435 |
import importlib
import os
import sys
from absl import app
from absl import flags
from absl import logging
import gin
from mesh_tensorflow.transformer import utils
import pkg_resources
import t5
from t5.models import mtf_model
import tensorflow.compat.v1 as tf
flags.DEFINE_string(
"tpu_job_name", None,
"Nam... | true | true |
1c108d11b2add4d3d81370726a0825de3c8479e3 | 1,641 | py | Python | blend/Minification.py | azavea/blend | 2cafbc326f2e6b3f1947581cca860ff544adada1 | [
"MIT"
] | 1 | 2017-03-06T14:55:29.000Z | 2017-03-06T14:55:29.000Z | blend/Minification.py | azavea/blend | 2cafbc326f2e6b3f1947581cca860ff544adada1 | [
"MIT"
] | null | null | null | blend/Minification.py | azavea/blend | 2cafbc326f2e6b3f1947581cca860ff544adada1 | [
"MIT"
] | null | null | null | # By Justin Walgran
# Copyright (c) 2012 Azavea, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, ... | 34.1875 | 67 | 0.719683 |
from Result import Result
class Minification(Result):
def __init__(self):
super(Minification, self).__init__()
self._content = None
@property
def content(self):
return self._content
def set_content(self, content):
self._content = content
def __unicode__(self):
... | true | true |
1c108eb4dc0ad93e8ce92840a3aa73612c4625ea | 2,879 | py | Python | src/settings.py | Abdi-Adan/Django-User-App | 8d1066618313d58279c30b9828a6540ec0ee8b48 | [
"MIT"
] | 2 | 2020-07-12T19:10:21.000Z | 2020-08-28T13:39:59.000Z | src/settings.py | Abdi-Adan/Django-User-App | 8d1066618313d58279c30b9828a6540ec0ee8b48 | [
"MIT"
] | 5 | 2021-03-30T13:55:40.000Z | 2021-09-22T19:25:31.000Z | src/settings.py | Abdi-Adan/Django-User-App | 8d1066618313d58279c30b9828a6540ec0ee8b48 | [
"MIT"
] | null | null | null | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the... | 25.477876 | 93 | 0.683223 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'd)9@xs=am2kr77(4w!3x!ujc&m+s^fe(!@(3ya_2qitk0xdj$)'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes'... | true | true |
1c108ec387b3d720f63d44d853481d5dceafb9d8 | 5,489 | py | Python | pycon_conference_agenda_scraper.py | AmitAronovitch/zefferno_scripts | 5e0d8cf78314a6d98d9f7f5308fbe9972e45adbb | [
"Apache-2.0"
] | null | null | null | pycon_conference_agenda_scraper.py | AmitAronovitch/zefferno_scripts | 5e0d8cf78314a6d98d9f7f5308fbe9972e45adbb | [
"Apache-2.0"
] | 1 | 2018-03-28T03:15:33.000Z | 2018-03-28T03:15:33.000Z | pycon_conference_agenda_scraper.py | AmitAronovitch/zefferno_scripts | 5e0d8cf78314a6d98d9f7f5308fbe9972e45adbb | [
"Apache-2.0"
] | 1 | 2017-09-27T05:40:48.000Z | 2017-09-27T05:40:48.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
PyCon agenda web-scraper
"""
from __future__ import print_function
import sys, json
import os.path, tempfile, cPickle
import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
URL_BASE = "http://il.pycon.org"
URL_TABLE = URL_BASE + "/wwwpyconI... | 30.494444 | 117 | 0.598652 |
"""
PyCon agenda web-scraper
"""
from __future__ import print_function
import sys, json
import os.path, tempfile, cPickle
import requests
from bs4 import BeautifulSoup
from prettytable import PrettyTable
URL_BASE = "http://il.pycon.org"
URL_TABLE = URL_BASE + "/wwwpyconIL/agenda-table"
def _notnull(data, key):
... | false | true |
1c108fbf8ff6bb3ae332e12102cbcf392225327b | 25,645 | py | Python | mlflow/store/file_store.py | kylemeyer1/mlflow | 56d080707853fedcb0ddc5febf4d30ff3e47000e | [
"Apache-2.0"
] | 2 | 2019-09-09T23:45:08.000Z | 2021-11-02T04:35:49.000Z | mlflow/store/file_store.py | kylemeyer1/mlflow | 56d080707853fedcb0ddc5febf4d30ff3e47000e | [
"Apache-2.0"
] | null | null | null | mlflow/store/file_store.py | kylemeyer1/mlflow | 56d080707853fedcb0ddc5febf4d30ff3e47000e | [
"Apache-2.0"
] | null | null | null | import logging
import os
import uuid
import six
from mlflow.entities import Experiment, Metric, Param, Run, RunData, RunInfo, RunStatus, RunTag, \
ViewType
from mlflow.entities.lifecycle_stage import LifecycleStage
from mlflow.entities.run_info import check_run_is_active, check_run_is_dele... | 47.490741 | 100 | 0.656736 | import logging
import os
import uuid
import six
from mlflow.entities import Experiment, Metric, Param, Run, RunData, RunInfo, RunStatus, RunTag, \
ViewType
from mlflow.entities.lifecycle_stage import LifecycleStage
from mlflow.entities.run_info import check_run_is_active, check_run_is_dele... | true | true |
1c10908f34f2850cba438e945e053035a384b4be | 226 | py | Python | hexa/comments/admin.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 4 | 2021-07-19T12:53:21.000Z | 2022-01-26T17:45:02.000Z | hexa/comments/admin.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 20 | 2021-05-17T12:27:06.000Z | 2022-03-30T11:35:26.000Z | hexa/comments/admin.py | qgerome/openhexa-app | 8c9377b2ad972121d8e9575f5d52420212b52ed4 | [
"MIT"
] | 2 | 2021-09-07T04:19:59.000Z | 2022-02-08T15:33:29.000Z | from django.contrib import admin
from hexa.comments.models import Comment
@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
list_display = ("user", "index", "created_at")
search_fields = ("user.name",)
| 22.6 | 50 | 0.738938 | from django.contrib import admin
from hexa.comments.models import Comment
@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
list_display = ("user", "index", "created_at")
search_fields = ("user.name",)
| true | true |
1c1090a2c17c9d2e9e131b599107fc6e972ee186 | 7,055 | py | Python | jc/parsers/crontab_u.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | jc/parsers/crontab_u.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | jc/parsers/crontab_u.py | philippeitis/jc | d96b3a65a98bc135d21d4feafc0a43317b5a11fa | [
"MIT"
] | null | null | null | """jc - JSON CLI output utility crontab file Parser
Usage:
specify --crontab-u as the first argument if the piped input is coming from a crontab file with User specified
Compatibility:
'linux', 'darwin', 'aix', 'freebsd'
Examples:
$ cat /etc/crontab | jc --crontab-u -p
{
"variables": [
... | 25.748175 | 114 | 0.446775 | import jc.utils
import jc.parsers.universal
class info():
version = '1.0'
description = 'crontab file parser with user support'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
compatible = ['linux', 'darwin', 'aix', 'freebsd']
__version__ = info.version
def process(p... | true | true |
1c10910fb8414086333c053a61513bf75f3f99d7 | 366 | py | Python | Chapter 3/Q17_Yourclass.py | inshaal/CBSE_NCERT_SOLUTIONS | 0804c2b42e80ccf42ad7dc4d91998848529e216d | [
"Unlicense"
] | null | null | null | Chapter 3/Q17_Yourclass.py | inshaal/CBSE_NCERT_SOLUTIONS | 0804c2b42e80ccf42ad7dc4d91998848529e216d | [
"Unlicense"
] | null | null | null | Chapter 3/Q17_Yourclass.py | inshaal/CBSE_NCERT_SOLUTIONS | 0804c2b42e80ccf42ad7dc4d91998848529e216d | [
"Unlicense"
] | null | null | null | ''' Q17 Yourclass question on page 63'''
class Yourclass:
marks=10 #class variable
name="ABC"
def __init__(self,marks,name):
self.marks=marks #instance attribute
self.name=name
def dislay(self):
print marks
print name
obj=Yourclass(10,"ABC") #THIS IS... | 20.333333 | 56 | 0.614754 | ''' Q17 Yourclass question on page 63'''
class Yourclass:
marks=10 name="ABC"
def __init__(self,marks,name):
self.marks=marks self.name=name
def dislay(self):
print marks
print name
obj=Yourclass(10,"ABC") obj1=Yourclass
| false | true |
1c10912f2a11ca98cbf5f7c356ecb93bc6d73875 | 614 | py | Python | blog/migrations/0006_post_tags.py | Chaitya62/Personal-Blog | 61dacfb514d8e66363b80a475253c83d646502ee | [
"Apache-2.0"
] | null | null | null | blog/migrations/0006_post_tags.py | Chaitya62/Personal-Blog | 61dacfb514d8e66363b80a475253c83d646502ee | [
"Apache-2.0"
] | null | null | null | blog/migrations/0006_post_tags.py | Chaitya62/Personal-Blog | 61dacfb514d8e66363b80a475253c83d646502ee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-01-22 12:48
from __future__ import unicode_literals
from django.db import migrations
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0002_auto_20150616_2121'),
('blog', '0005_auto_20170122_1149'... | 26.695652 | 162 | 0.64658 | from __future__ import unicode_literals
from django.db import migrations
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0002_auto_20150616_2121'),
('blog', '0005_auto_20170122_1149'),
]
operations = [
migrations.AddField(
m... | true | true |
1c10923e088b796764e3cc01bbda7da8351a85bf | 76 | py | Python | scipy/linalg/tests/test_misc.py | jcharlong/scipy | 153467a9174b0c6f4b90ffeed5871e5018658108 | [
"BSD-3-Clause"
] | 9,095 | 2015-01-02T18:24:23.000Z | 2022-03-31T20:35:31.000Z | scipy/linalg/tests/test_misc.py | jcharlong/scipy | 153467a9174b0c6f4b90ffeed5871e5018658108 | [
"BSD-3-Clause"
] | 11,500 | 2015-01-01T01:15:30.000Z | 2022-03-31T23:07:35.000Z | scipy/linalg/tests/test_misc.py | jcharlong/scipy | 153467a9174b0c6f4b90ffeed5871e5018658108 | [
"BSD-3-Clause"
] | 5,838 | 2015-01-05T11:56:42.000Z | 2022-03-31T23:21:19.000Z | from scipy.linalg import norm
def test_norm():
assert norm([]) == 0.0
| 12.666667 | 29 | 0.644737 | from scipy.linalg import norm
def test_norm():
assert norm([]) == 0.0
| true | true |
1c109276ec36d7918511e5afa9cf77438407b923 | 1,464 | py | Python | caac_package/ProjectConfig.py | jfcherng/CAAC-Toolkit | 5392ba4864a7cfaccdbae223dc6052f80bc50c00 | [
"MIT"
] | null | null | null | caac_package/ProjectConfig.py | jfcherng/CAAC-Toolkit | 5392ba4864a7cfaccdbae223dc6052f80bc50c00 | [
"MIT"
] | 1 | 2019-04-22T19:59:54.000Z | 2019-05-07T19:51:01.000Z | caac_package/ProjectConfig.py | jfcherng/CAAC-Toolkit | 5392ba4864a7cfaccdbae223dc6052f80bc50c00 | [
"MIT"
] | null | null | null | import os
import sys
from .Year import Year
class ProjectConfig:
# @see https://pythonhosted.org/PyInstaller/runtime-information.html
# we are running in a bundle
if getattr(sys, "frozen", False):
# we are running in a one-file bundle
if getattr(sys, "executable", ""):
__scrip... | 34.046512 | 96 | 0.672131 | import os
import sys
from .Year import Year
class ProjectConfig:
if getattr(sys, "frozen", False):
if getattr(sys, "executable", ""):
__script_dir__ = os.path.dirname(os.path.abspath(sys.executable))
else:
__script_dir__ = sys._MEIPASS
else:... | true | true |
1c109403aea1c7e014df369ebcec2f6d66754720 | 4,902 | py | Python | topic_sort.py | maxwelljohn/topic-sort | 212bbd8be6c4bcb32a414f236088eb523913b151 | [
"MIT"
] | 1 | 2019-09-23T18:22:37.000Z | 2019-09-23T18:22:37.000Z | topic_sort.py | maxwelljohn/topic-sort | 212bbd8be6c4bcb32a414f236088eb523913b151 | [
"MIT"
] | null | null | null | topic_sort.py | maxwelljohn/topic-sort | 212bbd8be6c4bcb32a414f236088eb523913b151 | [
"MIT"
] | null | null | null | #!/usr/bin/env python -O
import argparse
import nltk
import numpy as np
import pytest
import re
import optimizers
import order_problem
nltk.download('stopwords', quiet=True)
nltk.download('punkt', quiet=True)
nltk.download('wordnet', quiet=True)
PASSAGE_SEPARATOR = "\n\n"
STOPWORDS = set(nltk.corpus.stopwords.words... | 29.709091 | 79 | 0.611587 |
import argparse
import nltk
import numpy as np
import pytest
import re
import optimizers
import order_problem
nltk.download('stopwords', quiet=True)
nltk.download('punkt', quiet=True)
nltk.download('wordnet', quiet=True)
PASSAGE_SEPARATOR = "\n\n"
STOPWORDS = set(nltk.corpus.stopwords.words('english'))
STOPWORDS.ad... | true | true |
1c109424d23ee4be2176eff760dba088af6f9736 | 13,115 | py | Python | tfx/orchestration/pipeline.py | v1incent/tfx | ce6d6f64d326be3d57761a31b60f951fa95a39e5 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/pipeline.py | v1incent/tfx | ce6d6f64d326be3d57761a31b60f951fa95a39e5 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/pipeline.py | v1incent/tfx | ce6d6f64d326be3d57761a31b60f951fa95a39e5 | [
"Apache-2.0"
] | 1 | 2020-12-13T22:07:53.000Z | 2020-12-13T22:07:53.000Z | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.622356 | 98 | 0.674266 |
import enum
from typing import Collection, List, Optional, Union, cast
from tfx.dsl.compiler import constants
from tfx.dsl.components.base import base_node
from tfx.dsl.components.base import executor_spec
from tfx.dsl.placeholder import placeholder as ph
from tfx.orchestration import data_types
from tfx.orchestratio... | true | true |
1c10947c361e32863468adfa4ccbf17028a89bc5 | 323 | py | Python | catkin_ws/src/duckiebot_visualizer/setup.py | DiegoOrtegoP/Software | 4a07dd2dab29db910ca2e26848fa6b53b7ab00cd | [
"CC-BY-2.0"
] | 12 | 2016-04-14T12:21:46.000Z | 2021-06-18T07:51:40.000Z | catkin_ws/src/duckiebot_visualizer/setup.py | DiegoOrtegoP/Software | 4a07dd2dab29db910ca2e26848fa6b53b7ab00cd | [
"CC-BY-2.0"
] | 14 | 2017-03-03T23:33:05.000Z | 2018-04-03T18:07:53.000Z | catkin_ws/src/duckiebot_visualizer/setup.py | DiegoOrtegoP/Software | 4a07dd2dab29db910ca2e26848fa6b53b7ab00cd | [
"CC-BY-2.0"
] | 113 | 2016-05-03T06:11:42.000Z | 2019-06-01T14:37:38.000Z | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['duckiebot_visualizer'],
package_dir={'': 'include'},
)
setup(**setup_ar... | 26.916667 | 61 | 0.773994 |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
setup_args = generate_distutils_setup(
packages=['duckiebot_visualizer'],
package_dir={'': 'include'},
)
setup(**setup_args) | true | true |
1c10950295a32d32d5238ab3ea08d9f3cbfc6669 | 101 | py | Python | bin/cache_lmtdb.py | NERSC/pytokio | 22244718cf82567c50620cbe0e635dfc990de36b | [
"BSD-3-Clause-LBNL"
] | 22 | 2017-11-14T01:30:48.000Z | 2022-01-01T21:51:00.000Z | bin/cache_lmtdb.py | glennklockwood/pytokio | 22244718cf82567c50620cbe0e635dfc990de36b | [
"BSD-3-Clause-LBNL"
] | 39 | 2017-12-20T01:42:19.000Z | 2020-05-28T21:17:26.000Z | bin/cache_lmtdb.py | glennklockwood/pytokio | 22244718cf82567c50620cbe0e635dfc990de36b | [
"BSD-3-Clause-LBNL"
] | 5 | 2018-02-06T19:39:19.000Z | 2019-07-10T01:20:26.000Z | #!/usr/bin/env python
from tokio.cli.cache_lmtdb import main
if __name__ == "__main__":
main()
| 14.428571 | 38 | 0.693069 |
from tokio.cli.cache_lmtdb import main
if __name__ == "__main__":
main()
| true | true |
1c1095f5f37cb41b6318b6beaf6df6c400bfad6c | 17,334 | py | Python | V2RaycSpider1225/src/BusinessCentralLayer/scaffold.py | njchj/V2RayCloudSpider | 16154cf48c74fa2c8cf2f6792d2db3632501f5d6 | [
"MIT"
] | 1 | 2021-09-28T09:38:15.000Z | 2021-09-28T09:38:15.000Z | V2RaycSpider1225/src/BusinessCentralLayer/scaffold.py | njchj/V2RayCloudSpider | 16154cf48c74fa2c8cf2f6792d2db3632501f5d6 | [
"MIT"
] | null | null | null | V2RaycSpider1225/src/BusinessCentralLayer/scaffold.py | njchj/V2RayCloudSpider | 16154cf48c74fa2c8cf2f6792d2db3632501f5d6 | [
"MIT"
] | 1 | 2021-09-09T07:22:47.000Z | 2021-09-09T07:22:47.000Z | __all__ = ['scaffold', 'command_set']
from gevent import monkey
monkey.patch_all()
import csv
import os
import sys
import time
import shutil
from typing import List
import gevent
from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, \
REDIS_MASTER, SERVER_DIR_DATABASE_CACHE, SE... | 37.038462 | 119 | 0.546267 | __all__ = ['scaffold', 'command_set']
from gevent import monkey
monkey.patch_all()
import csv
import os
import sys
import time
import shutil
from typing import List
import gevent
from src.BusinessCentralLayer.setting import logger, DEFAULT_POWER, CHROMEDRIVER_PATH, \
REDIS_MASTER, SERVER_DIR_DATABASE_CACHE, SE... | true | true |
1c10969b90b22e7195cb42a9faf4e063a0d09c63 | 5,912 | py | Python | api/client/src/pcluster_client/models/__init__.py | Chen188/aws-parallelcluster | 5e5f9025fe58fdb5c696f100858da1948561b888 | [
"Apache-2.0"
] | 415 | 2018-11-13T15:02:15.000Z | 2022-03-31T15:26:06.000Z | api/client/src/pcluster_client/models/__init__.py | Chen188/aws-parallelcluster | 5e5f9025fe58fdb5c696f100858da1948561b888 | [
"Apache-2.0"
] | 2,522 | 2018-11-13T16:16:27.000Z | 2022-03-31T13:57:10.000Z | api/client/src/pcluster_client/models/__init__.py | yuleiwan/aws-parallelcluster | aad2a3019ef4ad08d702f5acf41b152b3f7a0b46 | [
"Apache-2.0"
] | 164 | 2018-11-14T22:47:46.000Z | 2022-03-22T11:33:22.000Z | # flake8: noqa
# import all models into this package
# if you have many models here with many references from one model to another this may
# raise a RecursionError
# to avoid this, import only the models that you directly need like:
# from from pcluster_client.model.pet import Pet
# or import this package, but before... | 79.891892 | 135 | 0.922361 |
from pcluster_client.model.ami_info import AmiInfo
from pcluster_client.model.bad_request_exception_response_content import BadRequestExceptionResponseContent
from pcluster_client.model.build_image_bad_request_exception_response_content import BuildImageBadRequestExceptionResponseContent
from pcluster_client.model.bu... | true | true |
1c1096f6499535da21de5d0ce82dfc27a6456e57 | 3,697 | py | Python | ydkgen/printer/cpp/class_has_data_printer.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | ydkgen/printer/cpp/class_has_data_printer.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | ydkgen/printer/cpp/class_has_data_printer.py | geordish/ydk-gen | eb95b2a86f61180a773b18d0c65b6b906ed542ee | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# 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/LICENS... | 42.494253 | 151 | 0.622667 |
class ClassHasDataPrinter(object):
def __init__(self, ctx):
self.ctx = ctx
def print_class_has_data(self, clazz, leafs, children):
conditions = self._init_has_data_conditions(leafs, children)
self._print_function_header(clazz, 'has_data')
for child in children:
if ... | true | true |
1c109716ada1b7bb75617f701bb9d646df3c3982 | 359 | py | Python | source/forms/routes.py | mysky528/flask-gentelella | 673f04a3b0f1257279edbff32722452e1b7ae677 | [
"MIT"
] | null | null | null | source/forms/routes.py | mysky528/flask-gentelella | 673f04a3b0f1257279edbff32722452e1b7ae677 | [
"MIT"
] | null | null | null | source/forms/routes.py | mysky528/flask-gentelella | 673f04a3b0f1257279edbff32722452e1b7ae677 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template
from flask_login import login_required
blueprint = Blueprint(
'forms_blueprint',
__name__,
url_prefix='/forms',
template_folder='templates',
static_folder='static'
)
@blueprint.route('/<template>')
@login_required
def route_template(template):
retu... | 21.117647 | 46 | 0.743733 | from flask import Blueprint, render_template
from flask_login import login_required
blueprint = Blueprint(
'forms_blueprint',
__name__,
url_prefix='/forms',
template_folder='templates',
static_folder='static'
)
@blueprint.route('/<template>')
@login_required
def route_template(template):
retu... | true | true |
1c10977099ee2ecd1299cfc85df221f2e8b290fc | 25,289 | py | Python | sdks/python/private_instagram_sdk/api_client.py | pormes/pormes_bot17 | de194ef4641a09a2f6c44d00d3de4c39b3ae8b0a | [
"Apache-2.0"
] | 2 | 2020-07-13T18:11:22.000Z | 2020-10-07T17:13:09.000Z | sdks/python/private_instagram_sdk/api_client.py | pormes/pormes_bot17 | de194ef4641a09a2f6c44d00d3de4c39b3ae8b0a | [
"Apache-2.0"
] | null | null | null | sdks/python/private_instagram_sdk/api_client.py | pormes/pormes_bot17 | de194ef4641a09a2f6c44d00d3de4c39b3ae8b0a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Instagram API
The Instagram Private API in OpenAPI specs.v3.0 # noqa: E501
OpenAPI spec version: 0.0.1
GitHub repo: https://github.com/instagrambot/instagram-api-toolkit
"""
from __future__ import absolute_import
import datetime
import json
import mimetypes
from multiprocessing.p... | 39.329705 | 96 | 0.55103 | from __future__ import absolute_import
import datetime
import json
import mimetypes
from multiprocessing.pool import ThreadPool
import os
import re
import tempfile
import six
from six.moves.urllib.parse import quote
from private_instagram_sdk.configuration import Configuration
import private_instagram_sdk.models
fro... | true | true |
1c1099d4138c42674c135ef6a550d65bfd3a94c1 | 1,096 | py | Python | 0078_Subsets.py | yingzhuo1994/LeetCode | 636eef90867d21e3439d258ec99fbb8e5ad5a742 | [
"MIT"
] | null | null | null | 0078_Subsets.py | yingzhuo1994/LeetCode | 636eef90867d21e3439d258ec99fbb8e5ad5a742 | [
"MIT"
] | null | null | null | 0078_Subsets.py | yingzhuo1994/LeetCode | 636eef90867d21e3439d258ec99fbb8e5ad5a742 | [
"MIT"
] | null | null | null | class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
# 1st recursive solution
# O(n * 2^n) time | O(n * 2^n) space
if not nums:
return [[]]
last = self.subsets(nums[1:])
lst = [[nums[0]] + elem for elem in last] + last
return lst
... | 34.25 | 70 | 0.507299 | class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
if not nums:
return [[]]
last = self.subsets(nums[1:])
lst = [[nums[0]] + elem for elem in last] + last
return lst
def subsets(self, nums: List[int]) -> List[List[... | false | true |
1c109ab9bcb112d9f1b6edc180026fd79b131a35 | 1,887 | py | Python | exercises/en/solution_06_17.py | hfboyce/MCL-DSCI-571-machine-learning | 25757369491ac547daa94ff1143ca7389d433a6e | [
"MIT"
] | 1 | 2020-11-23T03:19:18.000Z | 2020-11-23T03:19:18.000Z | exercises/en/solution_06_17.py | hfboyce/MCL-DSCI-571-machine-learning | 25757369491ac547daa94ff1143ca7389d433a6e | [
"MIT"
] | 13 | 2020-10-02T16:48:24.000Z | 2020-12-09T18:58:21.000Z | exercises/en/solution_06_17.py | hfboyce/MCL-DSCI-571-machine-learning | 25757369491ac547daa94ff1143ca7389d433a6e | [
"MIT"
] | 2 | 2020-10-28T19:43:42.000Z | 2021-03-30T22:57:47.000Z | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split, cross_validate
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer, make_column_transformer
from sklearn.pipeline import Pipelin... | 34.309091 | 94 | 0.73026 | import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split, cross_validate
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer, make_column_transformer
from sklearn.pipeline import Pipelin... | true | true |
1c109ba050eb6b0037778b86b5a06468e1eab5c0 | 454 | py | Python | src/the_impossible/live/migrations/newsletter/migrations/0015_auto_20200717_0514.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | null | null | null | src/the_impossible/live/migrations/newsletter/migrations/0015_auto_20200717_0514.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | 2 | 2020-04-15T03:57:42.000Z | 2020-06-06T01:43:34.000Z | src/the_impossible/live/migrations/newsletter/migrations/0015_auto_20200717_0514.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-07-17 05:14
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('newsletter', '0014_auto_20200717_0203'),
]
operations = [
migrations.AlterField(
... | 21.619048 | 54 | 0.640969 |
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('newsletter', '0014_auto_20200717_0203'),
]
operations = [
migrations.AlterField(
model_name='subscriber',
name... | true | true |
1c109c04bb91b98f6354a282f04dec100aeff967 | 5,617 | py | Python | sim/hpa.py | GitHubDiom/faas-sim | d3dde280bd69641e6b6976f70effb3270d2364fa | [
"MIT"
] | null | null | null | sim/hpa.py | GitHubDiom/faas-sim | d3dde280bd69641e6b6976f70effb3270d2364fa | [
"MIT"
] | null | null | null | sim/hpa.py | GitHubDiom/faas-sim | d3dde280bd69641e6b6976f70effb3270d2364fa | [
"MIT"
] | null | null | null | import math
from sim.core import Environment
from sim.faas import FunctionState, FaasSystem
from sim.resource import MetricsServer
class HorizontalPodAutoscaler:
# Behavior and default values taken from:
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
# Official implementati... | 52.990566 | 120 | 0.661207 | import math
from sim.core import Environment
from sim.faas import FunctionState, FaasSystem
from sim.resource import MetricsServer
class HorizontalPodAutoscaler:
def __init__(self, env: Environment, average_window: int = 100, reconcile_interval: int = 15,
target_tolerance: float = ... | true | true |
1c109c92bd343bbb91699c87d99b13616334f3ed | 1,129 | py | Python | 14/main2.py | staadecker/advent-of-code-2020 | 9ab0703099c750d90e4fa167438f8fc97302c81b | [
"MIT"
] | null | null | null | 14/main2.py | staadecker/advent-of-code-2020 | 9ab0703099c750d90e4fa167438f8fc97302c81b | [
"MIT"
] | null | null | null | 14/main2.py | staadecker/advent-of-code-2020 | 9ab0703099c750d90e4fa167438f8fc97302c81b | [
"MIT"
] | null | null | null | with open("input.txt", "r") as f:
instructions = f.readlines()
def get_addresses(root_address, mask):
if mask is None:
return [root_address]
addresses = [0]
pos_mask = 0x800000000
pos_index = 0
while pos_mask != 0:
mask_bit = mask[pos_index]
root_bit = root_address & po... | 26.255814 | 61 | 0.565102 | with open("input.txt", "r") as f:
instructions = f.readlines()
def get_addresses(root_address, mask):
if mask is None:
return [root_address]
addresses = [0]
pos_mask = 0x800000000
pos_index = 0
while pos_mask != 0:
mask_bit = mask[pos_index]
root_bit = root_address & po... | true | true |
1c109cc013ddad1f7b328612f4bd95278e7cf559 | 3,227 | py | Python | PHA/PHA/settings.py | Aditya-Komaravolu/Personalized-Health-Assistant | b6ef76a6687a031c63bb49fde77325f598b68a4b | [
"MIT"
] | null | null | null | PHA/PHA/settings.py | Aditya-Komaravolu/Personalized-Health-Assistant | b6ef76a6687a031c63bb49fde77325f598b68a4b | [
"MIT"
] | null | null | null | PHA/PHA/settings.py | Aditya-Komaravolu/Personalized-Health-Assistant | b6ef76a6687a031c63bb49fde77325f598b68a4b | [
"MIT"
] | null | null | null | """
Django settings for PHA project.
Generated by 'django-admin startproject' using Django 3.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib imp... | 25.409449 | 91 | 0.695073 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'ets*=43)#=ixhzjc3l&hl##d^05s8xjf*m+8o@y$_p#%&adg+i'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contentty... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.