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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0708616f08a260c1419d7f0d81636066307a8d | 10,446 | py | Python | gym_minigrid/wrappers.py | n0whereRuoxi/rl-starter-files | b2ae68d544f4665a62b3d782c44008ef050e9b62 | [
"MIT"
] | 1,475 | 2017-12-14T18:54:32.000Z | 2022-03-31T18:11:28.000Z | gym_minigrid/wrappers.py | n0whereRuoxi/rl-starter-files | b2ae68d544f4665a62b3d782c44008ef050e9b62 | [
"MIT"
] | 131 | 2017-12-18T21:54:17.000Z | 2022-03-29T22:19:09.000Z | gym_minigrid/wrappers.py | n0whereRuoxi/rl-starter-files | b2ae68d544f4665a62b3d782c44008ef050e9b62 | [
"MIT"
] | 489 | 2017-12-15T16:29:52.000Z | 2022-03-28T06:41:46.000Z | import math
import operator
from functools import reduce
import numpy as np
import gym
from gym import error, spaces, utils
from .minigrid import OBJECT_TO_IDX, COLOR_TO_IDX, STATE_TO_IDX
class ReseedWrapper(gym.core.Wrapper):
"""
Wrapper to always regenerate an environment with the same set of seeds.
Thi... | 29.178771 | 121 | 0.586732 | import math
import operator
from functools import reduce
import numpy as np
import gym
from gym import error, spaces, utils
from .minigrid import OBJECT_TO_IDX, COLOR_TO_IDX, STATE_TO_IDX
class ReseedWrapper(gym.core.Wrapper):
def __init__(self, env, seeds=[0], seed_idx=0):
self.seeds = list(seeds)
... | true | true |
1c0708b5fdb5389a5622ade01a5a5e218715cc3b | 9,280 | py | Python | hard-gists/790687/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/790687/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/790687/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
import math
import array
import random
import itertools
import collections
import pyaudio
class MMLStatus:
"""テンポとか音符の長さとかの情報を持つ"""
def __init__(self, T=120, L=4, O=4, Q=5, V=12):
self.T = T
self.L = L
self.O = O
... | 26.514286 | 104 | 0.491918 |
import re
import sys
import math
import array
import random
import itertools
import collections
import pyaudio
class MMLStatus:
"""テンポとか音符の長さとかの情報を持つ"""
def __init__(self, T=120, L=4, O=4, Q=5, V=12):
self.T = T
self.L = L
self.O = O
self.Q = Q
self.V = V
... | false | true |
1c0709c7756c53a2a0a989fdc40b0cd2a6388daf | 36,512 | py | Python | ionoscloud/api/request_api.py | ionos-cloud/sdk-python | bb22b5b93505b25de6aebae97c523a6c2242ec2e | [
"Apache-2.0"
] | null | null | null | ionoscloud/api/request_api.py | ionos-cloud/sdk-python | bb22b5b93505b25de6aebae97c523a6c2242ec2e | [
"Apache-2.0"
] | 6 | 2021-11-26T16:18:51.000Z | 2022-02-18T10:08:49.000Z | ionoscloud/api/request_api.py | ionos-cloud/sdk-python | bb22b5b93505b25de6aebae97c523a6c2242ec2e | [
"Apache-2.0"
] | 1 | 2021-04-20T09:29:17.000Z | 2021-04-20T09:29:17.000Z | from __future__ import absolute_import
import re # noqa: F401
import six
from ionoscloud.api_client import ApiClient
from ionoscloud.exceptions import ( # noqa: F401
ApiTypeError,
ApiValueError
)
class RequestApi(object):
def __init__(self, api_client=None):
if api_client is None:
... | 62.095238 | 434 | 0.660933 | from __future__ import absolute_import
import re import six
from ionoscloud.api_client import ApiClient
from ionoscloud.exceptions import ( ApiTypeError,
ApiValueError
)
class RequestApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
... | true | true |
1c070adf523fc4dd94f046ceb2d228166edae64b | 2,526 | py | Python | Project:-Make-Sense-of-Census/code.py | akhilmeleth/greyatom-python-for-data-science | 634530dc8bb25ea6283a53861bf701d94d1fb5e4 | [
"MIT"
] | null | null | null | Project:-Make-Sense-of-Census/code.py | akhilmeleth/greyatom-python-for-data-science | 634530dc8bb25ea6283a53861bf701d94d1fb5e4 | [
"MIT"
] | null | null | null | Project:-Make-Sense-of-Census/code.py | akhilmeleth/greyatom-python-for-data-science | 634530dc8bb25ea6283a53861bf701d94d1fb5e4 | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
#Loading data file and saving it into a new n... | 23.388889 | 61 | 0.71536 | import numpy as np
import warnings
warnings.filterwarnings('ignore')
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
data = np.genfromtxt(path, delimiter=",", skip_header=1)
data = np.genfromtxt(path, delimiter=",", skip_header=1)
print(data.shape)
census=np.concatenate((data, new_record),axis = 0)
... | true | true |
1c070cbf1d458e5c73ae8997a23b4305876c79af | 5,580 | py | Python | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | Nexenta/cinder-nedge1.1 | 66d0cb89e5425b4bd8d0597d9381797e40f32e02 | [
"Apache-2.0"
] | 3 | 2019-01-31T01:16:12.000Z | 2021-09-16T18:46:08.000Z | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | Nexenta/cinder-nedge1.1 | 66d0cb89e5425b4bd8d0597d9381797e40f32e02 | [
"Apache-2.0"
] | 5 | 2018-01-25T11:31:56.000Z | 2019-05-06T23:13:35.000Z | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | Nexenta/cinder-nedge1.1 | 66d0cb89e5425b4bd8d0597d9381797e40f32e02 | [
"Apache-2.0"
] | 11 | 2015-02-20T18:48:24.000Z | 2021-01-30T20:26:18.000Z | # Copyright (c) - 2014, Clinton Knight. All rights reserved.
# Copyright (c) - 2016 Mike Rooney. 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
#
# htt... | 39.857143 | 78 | 0.679928 |
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.netapp.dataontap import block_cmode
from cinder.zonemanager import utils as fczm_utils
@interface.volumedriver
class NetAppCmodeFibreChannelDriver(driver.BaseVD,
driver.ConsistencyGroupVD,
... | true | true |
1c070d015c4358913c0c5203feded54facae2aa8 | 237 | py | Python | sensors/piezobuzzer.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 2 | 2019-03-26T23:47:40.000Z | 2020-03-28T03:23:31.000Z | sensors/piezobuzzer.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 1 | 2019-03-27T10:59:14.000Z | 2019-03-27T10:59:14.000Z | sensors/piezobuzzer.py | akesiraju/raspberrypi | e8ae5e535a9953631ffa2d1e7de926c9dc19f961 | [
"MIT"
] | 1 | 2018-07-14T23:55:14.000Z | 2018-07-14T23:55:14.000Z | import RPi.GPIO as GPIO
import time
pin = 21
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.OUT)
for x in range(1,10):
GPIO.output(pin, GPIO.HIGH)
time.sleep(0.5)
GPIO.output(pin, GPIO.LOW)
time.sleep(0.2)
GPIO.cleanup() | 15.8 | 31 | 0.670886 | import RPi.GPIO as GPIO
import time
pin = 21
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.OUT)
for x in range(1,10):
GPIO.output(pin, GPIO.HIGH)
time.sleep(0.5)
GPIO.output(pin, GPIO.LOW)
time.sleep(0.2)
GPIO.cleanup() | true | true |
1c070e855d559a2ef279f2348eae27beb5e8f030 | 971 | py | Python | sdcflows/utils/tests/test_phasemanip.py | oesteban/sdcflows | 17feeb3056448067ff7a1f80a7717f7a5b1194a0 | [
"Apache-2.0"
] | null | null | null | sdcflows/utils/tests/test_phasemanip.py | oesteban/sdcflows | 17feeb3056448067ff7a1f80a7717f7a5b1194a0 | [
"Apache-2.0"
] | null | null | null | sdcflows/utils/tests/test_phasemanip.py | oesteban/sdcflows | 17feeb3056448067ff7a1f80a7717f7a5b1194a0 | [
"Apache-2.0"
] | null | null | null | """Test phase manipulation routines."""
import numpy as np
import nibabel as nb
from ..phasemanip import au2rads, phdiff2fmap
def test_au2rads(tmp_path):
"""Check the conversion."""
data = np.random.randint(0, high=4096, size=(5, 5, 5))
data[0, 0, 0] = 0
data[-1, -1, -1] = 4096
nb.Nifti1Image(da... | 27.742857 | 88 | 0.625129 | import numpy as np
import nibabel as nb
from ..phasemanip import au2rads, phdiff2fmap
def test_au2rads(tmp_path):
data = np.random.randint(0, high=4096, size=(5, 5, 5))
data[0, 0, 0] = 0
data[-1, -1, -1] = 4096
nb.Nifti1Image(data.astype("int16"), np.eye(4)).to_filename(
tmp_path / "testdata... | true | true |
1c070eb2395ae48cde58a9cfc5e3446b9eb50792 | 15,345 | py | Python | python/graphframes/tests.py | fullcontact/graphframes | c2f477af7a2059d49ba56a78bc86ae4a056be08d | [
"Apache-2.0"
] | null | null | null | python/graphframes/tests.py | fullcontact/graphframes | c2f477af7a2059d49ba56a78bc86ae4a056be08d | [
"Apache-2.0"
] | null | null | null | python/graphframes/tests.py | fullcontact/graphframes | c2f477af7a2059d49ba56a78bc86ae4a056be08d | [
"Apache-2.0"
] | 1 | 2022-02-17T18:59:46.000Z | 2022-02-17T18:59:46.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 41.13941 | 105 | 0.60593 |
import sys
import tempfile
import shutil
import re
if sys.version_info[:2] <= (2, 6):
try:
import unittest2 as unittest
except ImportError:
sys.stderr.write('Please install unittest2 to test with Python 2.6 or earlier')
sys.exit(1)
else:
import unittest
from pyspark import SparkCo... | true | true |
1c070efd5f4d8a76d4015856a5a7c5db5b96e4cf | 1,530 | py | Python | ports/k210-standalone/builtin-py/fpioa_manager.py | alangman/MaixPy | d58620dd153fa0830436ec0df4ad704fbb94ee14 | [
"MIT"
] | 1 | 2020-04-08T07:25:24.000Z | 2020-04-08T07:25:24.000Z | ports/k210-standalone/builtin-py/fpioa_manager.py | alangman/MaixPy | d58620dd153fa0830436ec0df4ad704fbb94ee14 | [
"MIT"
] | null | null | null | ports/k210-standalone/builtin-py/fpioa_manager.py | alangman/MaixPy | d58620dd153fa0830436ec0df4ad704fbb94ee14 | [
"MIT"
] | 1 | 2019-09-09T08:06:33.000Z | 2019-09-09T08:06:33.000Z | import board
import machine
class fpioa_manager:
def __init__(self):
self.board_dict={}
self.fpioa_dict={}
self.fpioa = machine.fpioa()
self.board_info = board.board_info()
def registered(self,pin,function):
ret = self.find_dict(pin,function)
if ret == 1:
... | 30 | 50 | 0.575163 | import board
import machine
class fpioa_manager:
def __init__(self):
self.board_dict={}
self.fpioa_dict={}
self.fpioa = machine.fpioa()
self.board_info = board.board_info()
def registered(self,pin,function):
ret = self.find_dict(pin,function)
if ret == 1:
... | true | true |
1c071001d34a9242a31d7650455e8e1adccbda7b | 665 | py | Python | tools/mo/openvino/tools/mo/front/mxnet/rnn_param_concat.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/openvino/tools/mo/front/mxnet/rnn_param_concat.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/openvino/tools/mo/front/mxnet/rnn_param_concat.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
from openvino.tools.mo.ops.concat import Concat
class RNNParamConcatFrontExtractor(FrontExt... | 28.913043 | 80 | 0.708271 |
from openvino.tools.mo.front.extractor import FrontExtractorOp
from openvino.tools.mo.front.mxnet.extractors.utils import get_mxnet_layer_attrs
from openvino.tools.mo.ops.concat import Concat
class RNNParamConcatFrontExtractor(FrontExtractorOp):
op = '_rnn_param_concat'
enabled = True
@classmethod
d... | true | true |
1c071088df322c84afa1766d3e9672edd2ecef99 | 1,032 | py | Python | tests/test_db_operators.py | Ed-XCF/bali | ac2facd7390309fa9bbfe32c3ca33bd7556096d8 | [
"MIT"
] | 18 | 2020-11-02T11:28:25.000Z | 2022-03-30T02:04:07.000Z | tests/test_db_operators.py | Ed-XCF/bali | ac2facd7390309fa9bbfe32c3ca33bd7556096d8 | [
"MIT"
] | 19 | 2020-10-13T05:39:01.000Z | 2022-02-19T16:26:56.000Z | tests/test_db_operators.py | Ed-XCF/bali | ac2facd7390309fa9bbfe32c3ca33bd7556096d8 | [
"MIT"
] | 9 | 2020-11-03T09:09:17.000Z | 2021-09-07T03:01:46.000Z | from sqlalchemy import Column, Integer, String
from bali.db import db
from bali.db.operators import get_filters_expr
DB_URI = 'sqlite:///:memory:'
def test_db_operators_fetch_rows():
db.connect(DB_URI)
class User(db.BaseModel):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
... | 24 | 82 | 0.578488 | from sqlalchemy import Column, Integer, String
from bali.db import db
from bali.db.operators import get_filters_expr
DB_URI = 'sqlite:///:memory:'
def test_db_operators_fetch_rows():
db.connect(DB_URI)
class User(db.BaseModel):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
... | true | true |
1c0710ebbb2fa7eed0dad5dc2db7056e7df34377 | 10,689 | py | Python | seek/seeksession.py | BMCBCC/NExtSEEK | 7aca407bbc74efc5beb4a98227c6864444b11f61 | [
"MIT"
] | null | null | null | seek/seeksession.py | BMCBCC/NExtSEEK | 7aca407bbc74efc5beb4a98227c6864444b11f61 | [
"MIT"
] | null | null | null | seek/seeksession.py | BMCBCC/NExtSEEK | 7aca407bbc74efc5beb4a98227c6864444b11f61 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''****************************************************************************
* Program - A class for running Seek queries through http session.
* Author - Huiming Ding: huiming@mit.edu
* This program is a trial software: you can redistribute it and/or modify
* it under the terms ... | 43.807377 | 235 | 0.541023 |
import requests
import getpass
class SeekSession(object):
def __init__(self, server, username, password):
self.__server = server
self.__username = username
self.__password = password
self.__headers1 = { "Accept": "application/vnd.api+json",
... | true | true |
1c07118e4669d0def3413949092c81def8feb8b3 | 3,357 | py | Python | google/devtools/cloudbuild/v1/devtools-cloudbuild-v1-py/google/devtools/cloudbuild_v1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/devtools/cloudbuild/v1/devtools-cloudbuild-v1-py/google/devtools/cloudbuild_v1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/devtools/cloudbuild/v1/devtools-cloudbuild-v1-py/google/devtools/cloudbuild_v1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 24.866667 | 74 | 0.712243 | from .cloudbuild import (
ApprovalConfig,
ApprovalResult,
ApproveBuildRequest,
ArtifactResult,
Artifacts,
Build,
BuildApproval,
BuildOperationMetadata,
BuildOptions,
BuildStep,
BuildTrigger,
BuiltImage,
CancelBuildRequest,
CreateBuildRequest,
CreateBuildTrigge... | true | true |
1c071208b37bd9c29e1a7eaf9da70ab3607bf6e4 | 1,531 | py | Python | rq_scheduler/utils.py | eprikazc/rq-scheduler | 6cd004f84faf76fc9e0d277223e7a86f13f0df90 | [
"MIT"
] | null | null | null | rq_scheduler/utils.py | eprikazc/rq-scheduler | 6cd004f84faf76fc9e0d277223e7a86f13f0df90 | [
"MIT"
] | null | null | null | rq_scheduler/utils.py | eprikazc/rq-scheduler | 6cd004f84faf76fc9e0d277223e7a86f13f0df90 | [
"MIT"
] | 1 | 2021-08-18T15:32:17.000Z | 2021-08-18T15:32:17.000Z | import calendar
import croniter
from datetime import datetime, timedelta
import logging
from rq.utils import ColorizingStreamHandler
# from_unix from times.from_unix()
def from_unix(string):
"""Convert a unix timestamp into a utc datetime"""
return datetime.utcfromtimestamp(float(string))
# to_unix from t... | 28.886792 | 77 | 0.691705 | import calendar
import croniter
from datetime import datetime, timedelta
import logging
from rq.utils import ColorizingStreamHandler
def from_unix(string):
return datetime.utcfromtimestamp(float(string))
def to_unix(dt):
return calendar.timegm(dt.utctimetuple())
def get_next_scheduled_time(cron_string):... | true | true |
1c0712b2aa4e02e245ec8ed72ae4400c37bf8b4f | 3,647 | py | Python | client-cli/tests/render/flatten/test_dataset_metadata.py | sndnv/stasis | ee99e8995f29b5b1c1689b87a84a60f01382bfd6 | [
"Apache-2.0"
] | 3 | 2021-01-12T22:40:30.000Z | 2021-06-09T04:33:19.000Z | client-cli/tests/render/flatten/test_dataset_metadata.py | sndnv/stasis | ee99e8995f29b5b1c1689b87a84a60f01382bfd6 | [
"Apache-2.0"
] | 12 | 2019-06-04T16:42:19.000Z | 2022-03-06T23:11:47.000Z | client-cli/tests/render/flatten/test_dataset_metadata.py | sndnv/stasis | ee99e8995f29b5b1c1689b87a84a60f01382bfd6 | [
"Apache-2.0"
] | 1 | 2021-01-12T22:40:10.000Z | 2021-01-12T22:40:10.000Z | import unittest
from uuid import uuid4
from client_cli.render.flatten.dataset_metadata import (
get_spec_changes,
get_spec_crates,
get_spec_filesystem,
get_spec_search_result,
flatten_changes,
flatten_crates,
flatten_filesystem,
flatten_search_result
)
from tests.mocks import mock_data
... | 40.977528 | 113 | 0.65122 | import unittest
from uuid import uuid4
from client_cli.render.flatten.dataset_metadata import (
get_spec_changes,
get_spec_crates,
get_spec_filesystem,
get_spec_search_result,
flatten_changes,
flatten_crates,
flatten_filesystem,
flatten_search_result
)
from tests.mocks import mock_data
... | true | true |
1c0712d0ae624ee691300ae4eec8d7b038b9cc70 | 2,153 | py | Python | semmc-fuzzer/fuzzermon/fuzzermon/main/models.py | pnwamk/semmc | f0765fdf6c7bb7348e0225aea3f2969a82d79f1f | [
"BSD-3-Clause"
] | 33 | 2018-07-15T20:43:17.000Z | 2021-04-05T18:02:13.000Z | semmc-fuzzer/fuzzermon/fuzzermon/main/models.py | pnwamk/semmc | f0765fdf6c7bb7348e0225aea3f2969a82d79f1f | [
"BSD-3-Clause"
] | 27 | 2018-08-17T21:34:31.000Z | 2022-01-24T21:18:09.000Z | semmc-fuzzer/fuzzermon/fuzzermon/main/models.py | pnwamk/semmc | f0765fdf6c7bb7348e0225aea3f2969a82d79f1f | [
"BSD-3-Clause"
] | 6 | 2019-10-29T18:47:24.000Z | 2021-07-02T13:16:11.000Z | from django.db import models
import signal
class User(models.Model):
username = models.CharField(max_length=64, unique=True)
class Arch(models.Model):
name = models.CharField(max_length=64, unique=True)
class Host(models.Model):
hostname = models.CharField(max_length=128, unique=True)
arch = models.F... | 39.145455 | 83 | 0.744542 | from django.db import models
import signal
class User(models.Model):
username = models.CharField(max_length=64, unique=True)
class Arch(models.Model):
name = models.CharField(max_length=64, unique=True)
class Host(models.Model):
hostname = models.CharField(max_length=128, unique=True)
arch = models.F... | true | true |
1c0715256fcd936299e82c5157d90474fa4e6608 | 2,347 | py | Python | config/urls.py | babamba/sideAppServer | 607d61cbea9d05fe902b9f8e772bbd9f7baca28c | [
"MIT"
] | null | null | null | config/urls.py | babamba/sideAppServer | 607d61cbea9d05fe902b9f8e772bbd9f7baca28c | [
"MIT"
] | 11 | 2020-06-05T20:13:15.000Z | 2022-02-26T10:02:03.000Z | config/urls.py | babamba/sideAppServer | 607d61cbea9d05fe902b9f8e772bbd9f7baca28c | [
"MIT"
] | null | null | null | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from rest_framework_jwt.views import obtain_jwt_token
from TodaySalary impor... | 34.014493 | 97 | 0.651044 | from django.conf import settings
from django.urls import include, path
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
from rest_framework_jwt.views import obtain_jwt_token
from TodaySalary impor... | true | true |
1c07173a161b00f6ad580cf3dde1b436f2830979 | 199 | py | Python | tdrs-backend/tdpservice/users/test/test_models.py | aquiljohnston/TDRS | eb2f5b13c9c4b1cdf799b5f88067137cb949781c | [
"CC0-1.0"
] | null | null | null | tdrs-backend/tdpservice/users/test/test_models.py | aquiljohnston/TDRS | eb2f5b13c9c4b1cdf799b5f88067137cb949781c | [
"CC0-1.0"
] | 4 | 2021-04-08T19:55:25.000Z | 2021-06-10T20:16:46.000Z | tdrs-backend/tdpservice/users/test/test_models.py | swagger-aquil/TDRS | eb2f5b13c9c4b1cdf799b5f88067137cb949781c | [
"CC0-1.0"
] | null | null | null | """Module for testing the user model."""
import pytest
@pytest.mark.django_db
def test_string_representation(user):
"""Test user string representation."""
assert str(user) == user.username
| 22.111111 | 42 | 0.728643 | import pytest
@pytest.mark.django_db
def test_string_representation(user):
assert str(user) == user.username
| true | true |
1c0717bbb9d0d5a924871a25ed60e192738f27f3 | 1,624 | py | Python | erikagnvall-python3/day01.py | clonest1ck/advent_of_code_2019 | afed1e795cb94ecd833f8820ca0463f5276feb61 | [
"Apache-2.0"
] | null | null | null | erikagnvall-python3/day01.py | clonest1ck/advent_of_code_2019 | afed1e795cb94ecd833f8820ca0463f5276feb61 | [
"Apache-2.0"
] | null | null | null | erikagnvall-python3/day01.py | clonest1ck/advent_of_code_2019 | afed1e795cb94ecd833f8820ca0463f5276feb61 | [
"Apache-2.0"
] | null | null | null | import os.path
def _read_input():
with open(os.path.basename(__file__).replace('.py', '.txt')) as f:
return [int(l) for l in f]
def _m2f(m):
return m // 3 - 2
def part1(masses):
return sum(_m2f(m) for m in masses)
def part2(modules):
total = 0
for m in modules:
f = _m2f(m)
... | 17.462366 | 70 | 0.596675 | import os.path
def _read_input():
with open(os.path.basename(__file__).replace('.py', '.txt')) as f:
return [int(l) for l in f]
def _m2f(m):
return m // 3 - 2
def part1(masses):
return sum(_m2f(m) for m in masses)
def part2(modules):
total = 0
for m in modules:
f = _m2f(m)
... | true | true |
1c0717fddfb1341273cf5cd8de71311caa0920e1 | 3,489 | py | Python | cfripper/rules/iam_roles.py | Morrolan/cfripper | 4ed32c7fce919e3873317d213595976e60e285f7 | [
"Apache-2.0"
] | null | null | null | cfripper/rules/iam_roles.py | Morrolan/cfripper | 4ed32c7fce919e3873317d213595976e60e285f7 | [
"Apache-2.0"
] | null | null | null | cfripper/rules/iam_roles.py | Morrolan/cfripper | 4ed32c7fce919e3873317d213595976e60e285f7 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018-2019 Skyscanner Ltd
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, softwar... | 44.164557 | 115 | 0.664374 | from pycfmodel.model.resources.iam_role import IAMRole
from ..config.regex import REGEX_IS_STAR, REGEX_WILDCARD_POLICY_ACTION
from ..model.rule import Rule
class IAMRolesOverprivilegedRule(Rule):
def invoke(self, cfmodel):
for logical_id, resource in cfmodel.Resources.items():
if isinstance(r... | true | true |
1c07184a24ea73e8cddc42569d4858bd6c6a307a | 30,713 | py | Python | analysis/02__motifs/01__cis_motif_model/01__cis_motif_model.py | Mele-Lab/2020_GenomeBiology_CisTransMPRA | 55da814dee39f232b746deb6c8110cd15d77c3dd | [
"MIT"
] | 2 | 2020-08-03T15:54:42.000Z | 2020-12-22T09:37:46.000Z | analysis/02__motifs/01__cis_motif_model/01__cis_motif_model.py | kmattioli/2019__cis_trans_MPRA | 55da814dee39f232b746deb6c8110cd15d77c3dd | [
"MIT"
] | null | null | null | analysis/02__motifs/01__cis_motif_model/01__cis_motif_model.py | kmattioli/2019__cis_trans_MPRA | 55da814dee39f232b746deb6c8110cd15d77c3dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # 01__cis_motif_model
#
# in this notebook, i find motifs whose disruption is significantly associated w/ cis effects using linear models
# In[1]:
import warnings
warnings.filterwarnings('ignore')
import itertools
import pandas as pd
import numpy as np
import matplotlib as ... | 26.847028 | 143 | 0.654576 |
import warnings
warnings.filterwarnings('ignore')
import itertools
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
import statsmodels.formula.api as smf
import sys
from itertools import combinations
from scipy.stat... | true | true |
1c071a6236a6a38695a0c29f582d0db52fe9e019 | 758 | py | Python | psono/administration/serializers/delete_ga.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 48 | 2018-04-19T15:50:58.000Z | 2022-01-23T15:58:11.000Z | psono/administration/serializers/delete_ga.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 9 | 2018-09-13T14:56:18.000Z | 2020-01-17T16:44:33.000Z | psono/administration/serializers/delete_ga.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 11 | 2019-09-20T11:53:47.000Z | 2021-07-18T22:41:31.000Z | from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers, exceptions
from restapi.fields import UUIDField
from restapi.models import Google_Authenticator
class DeleteGASerializer(serializers.Serializer):
google_authenticator_id = UUIDField(required=True)
def validate(sel... | 32.956522 | 95 | 0.754617 | from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers, exceptions
from restapi.fields import UUIDField
from restapi.models import Google_Authenticator
class DeleteGASerializer(serializers.Serializer):
google_authenticator_id = UUIDField(required=True)
def validate(sel... | true | true |
1c071bd72a91dd8cf6e7cb1fa60f5d65cd51226f | 3,881 | py | Python | math/numberTheory/modulo_equation.py | snowflying/algorithm-in-python | d92e211119b8a786807942c2765058e522e37769 | [
"WTFPL"
] | 1 | 2020-05-14T06:15:29.000Z | 2020-05-14T06:15:29.000Z | math/numberTheory/modulo_equation.py | snowflying/algorithm-in-python | d92e211119b8a786807942c2765058e522e37769 | [
"WTFPL"
] | null | null | null | math/numberTheory/modulo_equation.py | snowflying/algorithm-in-python | d92e211119b8a786807942c2765058e522e37769 | [
"WTFPL"
] | 1 | 2022-03-22T00:32:56.000Z | 2022-03-22T00:32:56.000Z | ''' mbinary
#########################################################################
# File : modulo_equation.py
# Author: mbinary
# Mail: zhuheqin1@gmail.com
# Blog: https://mbinary.xyz
# Github: https://github.com/mbinary
# Created Time: 2018-3-4 21:14
# Description:
`--` represents modulo symbol
###############... | 30.320313 | 80 | 0.475651 |
import re
from gcd import xgcd
from euler import phi
from isPrime import isPrime
from factor import factor
def ind(m,g):
return {j:i for i in range(m-1) \
for j in range(m) if (g**i-j)%m==0}
def gs(m,num=100):
p = phi(m)
mp = factor(p)
checkLst = [p//i for i in mp]
return [i for i i... | true | true |
1c071c5b08ab9806c0aac7d30a497549398ff343 | 1,520 | py | Python | rf/AddressBook.py | novikovdeveloper/python_traning | d65a497c9432be60fc55f6a840b7c66e0100f8cc | [
"Apache-2.0"
] | null | null | null | rf/AddressBook.py | novikovdeveloper/python_traning | d65a497c9432be60fc55f6a840b7c66e0100f8cc | [
"Apache-2.0"
] | null | null | null | rf/AddressBook.py | novikovdeveloper/python_traning | d65a497c9432be60fc55f6a840b7c66e0100f8cc | [
"Apache-2.0"
] | null | null | null | import json
import pytest
import os.path
from fixture.application import Application
from fixture.db import DbFixture
from model.group import Group
class AddressBook:
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
def __init__(self, config="target.json", browser="chrome"):
self.browder = browser
config_... | 33.043478 | 138 | 0.694079 | import json
import pytest
import os.path
from fixture.application import Application
from fixture.db import DbFixture
from model.group import Group
class AddressBook:
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
def __init__(self, config="target.json", browser="chrome"):
self.browder = browser
config_... | true | true |
1c071c764b20a39e54a9d415beaa264272f24fa2 | 8,250 | py | Python | test/functional/wallet_backup.py | fakecoinbase/pexaslashcore | dd0612727878844da7e47bdad0e0aca6c841aa81 | [
"MIT"
] | 19 | 2019-10-25T12:53:27.000Z | 2022-01-31T13:25:16.000Z | test/functional/wallet_backup.py | fakecoinbase/pexaslashcore | dd0612727878844da7e47bdad0e0aca6c841aa81 | [
"MIT"
] | 3 | 2020-12-23T16:17:31.000Z | 2020-12-26T10:12:37.000Z | test/functional/wallet_backup.py | fakecoinbase/pexaslashcore | dd0612727878844da7e47bdad0e0aca6c841aa81 | [
"MIT"
] | 6 | 2020-04-20T19:21:37.000Z | 2021-08-31T19:35:48.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Pexa Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each other,
f... | 36.995516 | 148 | 0.645091 | from decimal import Decimal
import os
from random import randint
import shutil
from test_framework.test_framework import PexaTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
connect_nodes,
)
class WalletBackupTest(PexaTestFramework):
def set_test_params(self):
... | true | true |
1c071cd8f879d36692ad79ba5ce8c8695f1ccc19 | 1,375 | py | Python | twydter_app/auth/forms.py | ttphan/twydter | e19f6bbfad2846245f71ff6f17e14ba053cc08fd | [
"MIT"
] | null | null | null | twydter_app/auth/forms.py | ttphan/twydter | e19f6bbfad2846245f71ff6f17e14ba053cc08fd | [
"MIT"
] | null | null | null | twydter_app/auth/forms.py | ttphan/twydter | e19f6bbfad2846245f71ff6f17e14ba053cc08fd | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from twydter_app.models import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
... | 40.441176 | 76 | 0.714909 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo
from twydter_app.models import User
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
... | true | true |
1c071d8d907db1a439134b34c7fb17b38befd594 | 171,036 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ethernet_lldp_oper.py | Maikor/ydk-py | b86c4a7c570ae3b2c5557d098420446df5de4929 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ethernet_lldp_oper.py | Maikor/ydk-py | b86c4a7c570ae3b2c5557d098420446df5de4929 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ethernet_lldp_oper.py | Maikor/ydk-py | b86c4a7c570ae3b2c5557d098420446df5de4929 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """ Cisco_IOS_XR_ethernet_lldp_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ethernet\-lldp package operational data.
This module contains definitions
for the following management objects\:
lldp\: Link Layer Discovery Protocol operational data
Copyright (c) 2013\-2018 by Cisco Syste... | 54.714012 | 376 | 0.37557 | from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error_handler import handle_type_error as _handle_type_error
c... | true | true |
1c071dcb63d23a8f0742cb95fe88d76596c59337 | 116 | py | Python | tests/asp/gringo/choice.010.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/gringo/choice.010.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/gringo/choice.010.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
{a} :- b.
{a} :- c.
b :- a.
c :- a.
{d}.
b :- d.
c :- d.
"""
output = """
{}
{d, c, b}
{d, c, b, a}
"""
| 7.733333 | 12 | 0.267241 | input = """
{a} :- b.
{a} :- c.
b :- a.
c :- a.
{d}.
b :- d.
c :- d.
"""
output = """
{}
{d, c, b}
{d, c, b, a}
"""
| true | true |
1c071eda85d45ca9c5e7ac8b8488f7969a763730 | 1,390 | bzl | Python | dotnet/private/rules/runfiles.bzl | tomdegoede/rules_dotnet | 95e93d650150c49b338060378cd64e95023c0ce3 | [
"Apache-2.0"
] | 1 | 2021-12-24T14:21:43.000Z | 2021-12-24T14:21:43.000Z | dotnet/private/rules/runfiles.bzl | tomdegoede/rules_dotnet | 95e93d650150c49b338060378cd64e95023c0ce3 | [
"Apache-2.0"
] | null | null | null | dotnet/private/rules/runfiles.bzl | tomdegoede/rules_dotnet | 95e93d650150c49b338060378cd64e95023c0ce3 | [
"Apache-2.0"
] | 1 | 2020-01-29T15:22:44.000Z | 2020-01-29T15:22:44.000Z | load(
"@io_bazel_rules_dotnet//dotnet/private:skylib/lib/paths.bzl",
"paths",
)
def CopyRunfiles(dotnet, runfiles, copy, symlink, executable, subdir):
created = []
for f in runfiles.files.to_list():
if f.basename.endswith(".ref.dll"):
continue
if f.basename == "mono" or f.ba... | 37.567568 | 122 | 0.519424 | load(
"@io_bazel_rules_dotnet//dotnet/private:skylib/lib/paths.bzl",
"paths",
)
def CopyRunfiles(dotnet, runfiles, copy, symlink, executable, subdir):
created = []
for f in runfiles.files.to_list():
if f.basename.endswith(".ref.dll"):
continue
if f.basename == "mono" or f.ba... | true | true |
1c072099610532a143368a75cdbb2ace4800b248 | 3,957 | py | Python | pelops/analysis/comparecameras.py | dave-lab41/pelops | 292af80dba190f9506519c8e13432fef648a2291 | [
"Apache-2.0"
] | 48 | 2016-12-11T15:43:28.000Z | 2021-02-28T14:16:42.000Z | pelops/analysis/comparecameras.py | dave-lab41/pelops | 292af80dba190f9506519c8e13432fef648a2291 | [
"Apache-2.0"
] | 100 | 2016-11-15T19:23:52.000Z | 2017-08-22T20:22:13.000Z | pelops/analysis/comparecameras.py | agude/pelops | 292af80dba190f9506519c8e13432fef648a2291 | [
"Apache-2.0"
] | 25 | 2016-11-15T17:49:32.000Z | 2020-02-17T13:04:26.000Z | """ camera comparison """
import itertools
from collections import defaultdict
import numpy as np
from tqdm import tnrange
from pelops.analysis.camerautil import (get_match_id, glue, make_good_bad,
nameit_cam, nameit_car)
def eval_good_bad(first, second, clf, featuredataset,... | 31.15748 | 95 | 0.680061 |
import itertools
from collections import defaultdict
import numpy as np
from tqdm import tnrange
from pelops.analysis.camerautil import (get_match_id, glue, make_good_bad,
nameit_cam, nameit_car)
def eval_good_bad(first, second, clf, featuredataset, goodmatches, badmatches, ... | true | true |
1c07219908c6a92f7d6e1e05b7efb2a884ec4818 | 66 | py | Python | src/arithmetic/operations.py | MSD-99/project_tmp | 55f045e89b583a26b36d1fee35b796c7e4dc3c50 | [
"MIT"
] | null | null | null | src/arithmetic/operations.py | MSD-99/project_tmp | 55f045e89b583a26b36d1fee35b796c7e4dc3c50 | [
"MIT"
] | null | null | null | src/arithmetic/operations.py | MSD-99/project_tmp | 55f045e89b583a26b36d1fee35b796c7e4dc3c50 | [
"MIT"
] | null | null | null | def add(a, b):
return a + b
def sub(a, b):
return a - b
| 9.428571 | 16 | 0.484848 | def add(a, b):
return a + b
def sub(a, b):
return a - b
| true | true |
1c0721b77d87d70343614188b7c3a682ca78b723 | 738 | py | Python | broker/errors.py | ebloc/ebloc-broker | 776a8d9d4642ed1ba4726c94da68d61bd81c098b | [
"MIT"
] | 3 | 2021-12-11T19:26:57.000Z | 2021-12-30T00:17:23.000Z | broker/errors.py | ebloc/ebloc-broker | 776a8d9d4642ed1ba4726c94da68d61bd81c098b | [
"MIT"
] | null | null | null | broker/errors.py | ebloc/ebloc-broker | 776a8d9d4642ed1ba4726c94da68d61bd81c098b | [
"MIT"
] | 1 | 2021-09-18T11:38:07.000Z | 2021-09-18T11:38:07.000Z | class BashCommandsException(Exception):
def __init__(self, returncode, output, error_msg):
self.returncode = returncode
self.output = output
self.error_msg = error_msg
Exception.__init__("Error in the executed command")
class HandlerException(Exception):
"""Generate HandlerExce... | 21.085714 | 60 | 0.689702 | class BashCommandsException(Exception):
def __init__(self, returncode, output, error_msg):
self.returncode = returncode
self.output = output
self.error_msg = error_msg
Exception.__init__("Error in the executed command")
class HandlerException(Exception):
class JobException(Except... | true | true |
1c0721d436c985ad0dcf0b5d8c7692f704876351 | 9,934 | py | Python | KM-02-ModelAndDetailGroups.py | dreierpawel/IronPythonRVT | e18a2924c9d1fa6c00b784b923e4858c9052b2b8 | [
"CC0-1.0"
] | null | null | null | KM-02-ModelAndDetailGroups.py | dreierpawel/IronPythonRVT | e18a2924c9d1fa6c00b784b923e4858c9052b2b8 | [
"CC0-1.0"
] | null | null | null | KM-02-ModelAndDetailGroups.py | dreierpawel/IronPythonRVT | e18a2924c9d1fa6c00b784b923e4858c9052b2b8 | [
"CC0-1.0"
] | null | null | null | import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Ele... | 39.895582 | 116 | 0.724683 | import clr
import sys
sys.path.append('C:\Program Files (x86)\IronPython 2.7\Lib')
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Ele... | true | true |
1c07221995a40bb90890591a6570d13ac84b2248 | 700 | py | Python | src/python/grpcio_tests/grpc_version.py | arghyadip01/grpc | 9e10bfc8a096ef91a327e22f84f10c0fabff4417 | [
"Apache-2.0"
] | 2 | 2021-02-21T18:38:30.000Z | 2021-02-22T19:24:38.000Z | src/python/grpcio_tests/grpc_version.py | arghyadip01/grpc | 9e10bfc8a096ef91a327e22f84f10c0fabff4417 | [
"Apache-2.0"
] | 1 | 2020-10-23T08:23:50.000Z | 2020-10-23T08:23:50.000Z | src/python/grpcio_tests/grpc_version.py | arghyadip01/grpc | 9e10bfc8a096ef91a327e22f84f10c0fabff4417 | [
"Apache-2.0"
] | 1 | 2020-10-20T19:41:33.000Z | 2020-10-20T19:41:33.000Z | # Copyright 2016 gRPC 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 writing... | 38.888889 | 96 | 0.761429 |
VERSION = '1.34.0.dev0'
| true | true |
1c072383554f30abe604192e10d9da56f7b57bb0 | 126 | py | Python | shatteredcake.py | brimatt16219/Kattis-solutions | feb97957513627568a70cc9a324e4234666f8855 | [
"MIT"
] | null | null | null | shatteredcake.py | brimatt16219/Kattis-solutions | feb97957513627568a70cc9a324e4234666f8855 | [
"MIT"
] | null | null | null | shatteredcake.py | brimatt16219/Kattis-solutions | feb97957513627568a70cc9a324e4234666f8855 | [
"MIT"
] | null | null | null | l = int(input())
n = int(input())
v = 0
for i in range(n):
a, b = map(int, input().split())
v += a * b
print(int(v/l)) | 11.454545 | 34 | 0.5 | l = int(input())
n = int(input())
v = 0
for i in range(n):
a, b = map(int, input().split())
v += a * b
print(int(v/l)) | true | true |
1c0723d266328c9f5a1a369d03d8eecada2d4119 | 6,222 | py | Python | pybind/nos/v7_1_0/brocade_isns_ext_rpc/isns_get_discovery_domain_set/input/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/brocade_isns_ext_rpc/isns_get_discovery_domain_set/input/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/brocade_isns_ext_rpc/isns_get_discovery_domain_set/input/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 48.992126 | 473 | 0.717293 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
1c072420e909e820bb711b03f31765d21b7fd301 | 8,464 | py | Python | pyclient/wallet/simplewallet_cli.py | roi19953/wallet | 65ce625c755f18cf56e83e9f50fe03dbf8cd16f6 | [
"Apache-2.0"
] | null | null | null | pyclient/wallet/simplewallet_cli.py | roi19953/wallet | 65ce625c755f18cf56e83e9f50fe03dbf8cd16f6 | [
"Apache-2.0"
] | null | null | null | pyclient/wallet/simplewallet_cli.py | roi19953/wallet | 65ce625c755f18cf56e83e9f50fe03dbf8cd16f6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 30.446043 | 80 | 0.666233 |
import argparse
import getpass
import logging
import os
import sys
import traceback
import pkg_resources
from colorlog import ColoredFormatter
from wallet.simplewallet_client import SimpleWalletClient
DISTRIBUTION_NAME = 'simplewallet'
DEFAULT_URL = 'http://rest-api:8008'
def create_console_handler(verbose_level)... | true | true |
1c0726758531adb35726c22ad7c34c480932cd48 | 16,448 | py | Python | src/appservice-kube/azext_appservice_kube/_params.py | shashankbarsin/azure-cli-extensions | 8f9d0652ce7fc7f0a4321f617a0b42cccec6a151 | [
"MIT"
] | 4 | 2019-08-20T02:58:03.000Z | 2020-05-22T10:23:11.000Z | src/appservice-kube/azext_appservice_kube/_params.py | shashankbarsin/azure-cli-extensions | 8f9d0652ce7fc7f0a4321f617a0b42cccec6a151 | [
"MIT"
] | 4 | 2019-08-29T07:20:57.000Z | 2021-12-21T10:04:53.000Z | src/appservice-kube/azext_appservice_kube/_params.py | shashankbarsin/azure-cli-extensions | 8f9d0652ce7fc7f0a4321f617a0b42cccec6a151 | [
"MIT"
] | 4 | 2019-08-29T02:52:14.000Z | 2021-09-14T10:41:48.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 81.425743 | 359 | 0.6616 |
from knack.arguments import CLIArgumentType
from azure.cli.command_modules.appservice._validators import (validate_site_create)
from azure.cli.core.commands.parameters import (resource_group_name_type, get_location_type,
get_resource_name_completion_list,
... | true | true |
1c07274bbc65582f8632f2e8c6ae1c87191650c9 | 184 | py | Python | openml/setups/__init__.py | eliask/openml-python | 7a612eaece2fd28315d99dda3e2393ada2f27478 | [
"BSD-3-Clause"
] | 1 | 2019-06-21T10:05:55.000Z | 2019-06-21T10:05:55.000Z | openml/setups/__init__.py | eliask/openml-python | 7a612eaece2fd28315d99dda3e2393ada2f27478 | [
"BSD-3-Clause"
] | null | null | null | openml/setups/__init__.py | eliask/openml-python | 7a612eaece2fd28315d99dda3e2393ada2f27478 | [
"BSD-3-Clause"
] | 1 | 2019-01-05T18:04:43.000Z | 2019-01-05T18:04:43.000Z | from .setup import OpenMLSetup
from .functions import get_setup, list_setups, setup_exists, initialize_model
__all__ = ['get_setup', 'list_setups', 'setup_exists', 'initialize_model'] | 46 | 77 | 0.804348 | from .setup import OpenMLSetup
from .functions import get_setup, list_setups, setup_exists, initialize_model
__all__ = ['get_setup', 'list_setups', 'setup_exists', 'initialize_model'] | true | true |
1c0727618b7254d68a22ae858de032e6c20ddbc5 | 2,218 | py | Python | quacc/recipes/psi4/core.py | arosen93/HT-ASE | a76542e7a2bc5bf6e7382d8f1387374eb2abc713 | [
"BSD-3-Clause-LBNL"
] | 9 | 2022-02-08T08:31:30.000Z | 2022-03-30T21:37:35.000Z | quacc/recipes/psi4/core.py | arosen93/HT-ASE | a76542e7a2bc5bf6e7382d8f1387374eb2abc713 | [
"BSD-3-Clause-LBNL"
] | 5 | 2022-02-02T21:47:59.000Z | 2022-03-18T21:28:52.000Z | quacc/recipes/psi4/core.py | arosen93/HT-ASE | a76542e7a2bc5bf6e7382d8f1387374eb2abc713 | [
"BSD-3-Clause-LBNL"
] | 3 | 2022-02-23T12:00:57.000Z | 2022-03-24T23:54:22.000Z | """Core recipes for Psi4"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict
from ase.atoms import Atoms
from ase.calculators.psi4 import Psi4
from jobflow import Maker, job
from monty.dev import requires
try:
import psi4
except:
psi4 = None
from quacc.schemas... | 25.494253 | 84 | 0.587917 | from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Dict
from ase.atoms import Atoms
from ase.calculators.psi4 import Psi4
from jobflow import Maker, job
from monty.dev import requires
try:
import psi4
except:
psi4 = None
from quacc.schemas.calc import summarize_run
f... | true | true |
1c0727ee281eb6d79d175aba299f9d007ab8a392 | 1,801 | py | Python | story_untangling/predictors/welford.py | dwlmt/Story-Untangling | c56354e305f06a508b63b913989ff8856e4db5b6 | [
"Unlicense"
] | 7 | 2020-09-12T22:32:33.000Z | 2022-02-07T08:37:04.000Z | story_untangling/predictors/welford.py | dwlmt/Story-Untangling | c56354e305f06a508b63b913989ff8856e4db5b6 | [
"Unlicense"
] | 2 | 2021-08-31T15:46:16.000Z | 2021-09-01T15:19:52.000Z | story_untangling/predictors/welford.py | dwlmt/Story-Untangling | c56354e305f06a508b63b913989ff8856e4db5b6 | [
"Unlicense"
] | 1 | 2021-06-02T09:33:27.000Z | 2021-06-02T09:33:27.000Z | import math
class Welford(object):
""" From the gist - https://gist.github.com/alexalemi/2151722#file-welford-py
Implements Welford's algorithm for computing a running mean
and standard deviation as described at:
http://www.johndcook.com/standard_deviation.html
can take single values or itera... | 24.671233 | 81 | 0.530261 | import math
class Welford(object):
def __init__(self, lst=None):
self.k = 0
self.M = 0
self.S = 0
self.__call__(lst)
def update(self, x):
if x is None:
return
self.k += 1
newM = self.M + (x - self.M) * 1. / self.k
newS = self.S + (... | true | true |
1c0728514ba27618c915c7f3e7eade65b4f06434 | 1,177 | py | Python | setup.py | Saritasa/django-s3direct | 10b59d2485c715f84037d750aa7e8e1d2922c717 | [
"MIT"
] | null | null | null | setup.py | Saritasa/django-s3direct | 10b59d2485c715f84037d750aa7e8e1d2922c717 | [
"MIT"
] | null | null | null | setup.py | Saritasa/django-s3direct | 10b59d2485c715f84037d750aa7e8e1d2922c717 | [
"MIT"
] | null | null | null | import os
import json
from setuptools import setup
f = open(os.path.join(os.path.dirname(__file__), 'README.md'))
readme = f.read()
f.close()
f = open(os.path.join(os.path.dirname(__file__), 'package.json'))
package = json.loads(f.read())
f.close()
setup(
name=package['name'],
version=package['version'],
... | 30.179487 | 72 | 0.636364 | import os
import json
from setuptools import setup
f = open(os.path.join(os.path.dirname(__file__), 'README.md'))
readme = f.read()
f.close()
f = open(os.path.join(os.path.dirname(__file__), 'package.json'))
package = json.loads(f.read())
f.close()
setup(
name=package['name'],
version=package['version'],
... | true | true |
1c072ae726093371eca0918389babfd6ebe646b0 | 2,394 | py | Python | mp3voicestamp_app/audio.py | MarcinOrlowski/mp3voicestamp | 67de357e52c3781d7e41753f07f4b4618c8ffdc6 | [
"MIT"
] | 6 | 2018-10-20T06:01:06.000Z | 2021-08-24T07:33:13.000Z | mp3voicestamp_app/audio.py | MarcinOrlowski/mp3voicestamp | 67de357e52c3781d7e41753f07f4b4618c8ffdc6 | [
"MIT"
] | 4 | 2018-10-01T09:27:27.000Z | 2018-10-02T17:57:37.000Z | mp3voicestamp_app/audio.py | MarcinOrlowski/mp3voicestamp | 67de357e52c3781d7e41753f07f4b4618c8ffdc6 | [
"MIT"
] | null | null | null | # coding=utf8
"""
MP3 Voice Stamp
Athletes' companion: adds synthetized voice overlay with various
info and on-going timer to your audio files
Copyright ©2018 Marcin Orlowski <mail [@] MarcinOrlowski.com>
https://github.com/MarcinOrlowski/Mp3VoiceStamp
"""
from __future__ import print_function
import re
f... | 29.925 | 114 | 0.60944 |
from __future__ import print_function
import re
from mp3voicestamp_app.util import Util
from mp3voicestamp_app.tools import Tools
class Audio(object):
def __init__(self, tools):
self.__tools = tools
def calculate_rms_amplitude(self, wav_file):
src_amplitude_cmd = [self.__tools.get_tool(T... | true | true |
1c072b496217bfc44357875702c1a37ff8ee2952 | 12,309 | py | Python | mmpose/datasets/datasets/top_down/topdown_jhmdb_dataset.py | stoil-ganev/mmpose | 88c984155d2a07f1d409cf6b3aee01a7ccdebdb8 | [
"Apache-2.0"
] | 1 | 2021-09-29T02:19:07.000Z | 2021-09-29T02:19:07.000Z | mmpose/datasets/datasets/top_down/topdown_jhmdb_dataset.py | stoil-ganev/mmpose | 88c984155d2a07f1d409cf6b3aee01a7ccdebdb8 | [
"Apache-2.0"
] | null | null | null | mmpose/datasets/datasets/top_down/topdown_jhmdb_dataset.py | stoil-ganev/mmpose | 88c984155d2a07f1d409cf6b3aee01a7ccdebdb8 | [
"Apache-2.0"
] | 1 | 2021-10-20T04:43:28.000Z | 2021-10-20T04:43:28.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import os
import warnings
from collections import OrderedDict
import json_tricks as json
import numpy as np
from mmcv import Config
from mmpose.core.evaluation.top_down_eval import keypoint_pck_accuracy
from ...builder import DATASETS
from .topdown_coco_dataset import T... | 35.472622 | 79 | 0.524657 | import os
import warnings
from collections import OrderedDict
import json_tricks as json
import numpy as np
from mmcv import Config
from mmpose.core.evaluation.top_down_eval import keypoint_pck_accuracy
from ...builder import DATASETS
from .topdown_coco_dataset import TopDownCocoDataset
@DATASETS.register_module()
... | true | true |
1c072bdfb62eec4011ea8c188853b2cca671d203 | 1,932 | py | Python | vitrage/storage/__init__.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 89 | 2015-09-30T21:42:17.000Z | 2022-03-28T16:31:19.000Z | vitrage/storage/__init__.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 4 | 2015-12-13T13:06:53.000Z | 2016-01-03T19:51:28.000Z | vitrage/storage/__init__.py | openstack/vitrage | 95b33dbf39b040e23915882a2879c87aec239ca9 | [
"Apache-2.0"
] | 43 | 2015-11-04T15:54:27.000Z | 2021-12-10T14:24:03.000Z | # Copyright 2017 - Nokia
#
# 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... | 29.723077 | 75 | 0.706522 |
from oslo_config import cfg
from oslo_log import log
from stevedore import driver
import tenacity
from urllib import parse as urlparse
from vitrage.utils.datetime import utcnow
_NAMESPACE = 'vitrage.storage'
CONF = cfg.CONF
LOG = log.getLogger(__name__)
OPTS = []
def get_connection_from_config():
retries = ... | true | true |
1c072be88278b6be3b3745715d3db4e8fb6b4aa9 | 823 | py | Python | pystol-operator/tests/test_sample.py | ccamacho/pystol | 7925461c324975c8334009e3b878debcf056698b | [
"Apache-2.0"
] | 17 | 2020-03-18T13:49:23.000Z | 2022-02-17T04:38:19.000Z | pystol-operator/tests/test_sample.py | ccamacho/pystol | 7925461c324975c8334009e3b878debcf056698b | [
"Apache-2.0"
] | 2 | 2021-05-18T07:44:34.000Z | 2021-10-07T13:49:57.000Z | pystol-operator/tests/test_sample.py | ccamacho/pystol | 7925461c324975c8334009e3b878debcf056698b | [
"Apache-2.0"
] | 44 | 2019-10-23T20:26:31.000Z | 2021-11-12T12:19:41.000Z | #!/usr/bin/env python
"""
Copyright 2019 Pystol (pystol.org).
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 agre... | 25.71875 | 73 | 0.703524 |
def test_file1_method1():
x = 5
y = 6
assert x + 1 == y, "test failed"
def test_file1_method2():
x = 5
y = 6
assert x + 1 == y, "test failed"
| true | true |
1c072d306f8f8d860e7eaf8cd8eae3e2c93e930b | 1,170 | py | Python | imagetrac_docker/contrib/sites/migrations/0003_set_site_domain_and_name.py | arsenalstriker14/imagetraccloud | 04004d5eabc82e85596bc9e110c9250d5f882e17 | [
"MIT"
] | null | null | null | imagetrac_docker/contrib/sites/migrations/0003_set_site_domain_and_name.py | arsenalstriker14/imagetraccloud | 04004d5eabc82e85596bc9e110c9250d5f882e17 | [
"MIT"
] | null | null | null | imagetrac_docker/contrib/sites/migrations/0003_set_site_domain_and_name.py | arsenalstriker14/imagetraccloud | 04004d5eabc82e85596bc9e110c9250d5f882e17 | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations... | 24.893617 | 129 | 0.652137 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
Site = apps.get_model('sites', 'Site')
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
'domain': 'imagetraccloud.... | true | true |
1c072d31081d5a08f5d7a21101ad1272158c6dec | 359 | py | Python | indicators/migrations/0044_merge_20181228_1340.py | mercycorps/TolaWorkflow | 59542132fafd611081adb0e8cfaa04abc5886d7a | [
"Apache-2.0"
] | null | null | null | indicators/migrations/0044_merge_20181228_1340.py | mercycorps/TolaWorkflow | 59542132fafd611081adb0e8cfaa04abc5886d7a | [
"Apache-2.0"
] | 268 | 2020-03-31T15:46:59.000Z | 2022-03-31T18:01:08.000Z | indicators/migrations/0044_merge_20181228_1340.py | Falliatcom-sa/falliatcom | 39fb926de072c296ed32d50cccfb8003ca870739 | [
"Apache-2.0"
] | 1 | 2021-01-05T01:58:24.000Z | 2021-01-05T01:58:24.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-12-28 21:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('indicators', '0043_indicator_setup_remove_asterisks'),
('indicators', '0043_merge_20181219_1... | 21.117647 | 64 | 0.682451 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('indicators', '0043_indicator_setup_remove_asterisks'),
('indicators', '0043_merge_20181219_1137'),
]
operations = [
]
| true | true |
1c072e0f08379b61b0d0d97bcfb9b2226e2c2f06 | 4,940 | py | Python | services/solr-names-updater/q_cli.py | eve-git/namex | 130f261500ce595b291d5428c32e1f6cc38ea505 | [
"Apache-2.0"
] | 4 | 2018-10-05T23:41:05.000Z | 2019-06-19T16:17:50.000Z | services/solr-names-updater/q_cli.py | eve-git/namex | 130f261500ce595b291d5428c32e1f6cc38ea505 | [
"Apache-2.0"
] | 635 | 2018-05-31T04:12:46.000Z | 2022-03-31T18:45:42.000Z | services/solr-names-updater/q_cli.py | thorwolpert/namex | b9d927774e4c0da0255ca5aaa7ed1890283956fd | [
"Apache-2.0"
] | 71 | 2018-05-14T20:47:55.000Z | 2022-03-31T23:08:30.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 2019 Province of British Columbia
#
# 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... | 35.285714 | 107 | 0.610121 |
import asyncio
import functools
import getopt
import json
import os
import random
import signal
import sys
import uuid
from nats.aio.client import Client as NATS from stan.aio.client import Client as STAN
from queue_common.service_utils import error_cb, logger, signal_handler
async def run(loop, payload_values):... | true | true |
1c072e6aad3e3e024f07c2255c46e88552e3c74b | 87 | py | Python | cvgear/framework/torch/__init__.py | ivanpp/cvgear | a09ab5119f6578d7960042180d66141cf66d4dae | [
"MIT"
] | 1 | 2020-05-20T03:33:15.000Z | 2020-05-20T03:33:15.000Z | cvgear/framework/torch/__init__.py | ivanpp/cvgear | a09ab5119f6578d7960042180d66141cf66d4dae | [
"MIT"
] | null | null | null | cvgear/framework/torch/__init__.py | ivanpp/cvgear | a09ab5119f6578d7960042180d66141cf66d4dae | [
"MIT"
] | null | null | null | from .loader import TorchNestedLoader
from .loader_advanced import TorchNestedLoaderAdv | 43.5 | 49 | 0.896552 | from .loader import TorchNestedLoader
from .loader_advanced import TorchNestedLoaderAdv | true | true |
1c072f1a451ea06312055179a1a074703c6454be | 72 | py | Python | python/testData/formatter/blankLineBetweenMethods.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/formatter/blankLineBetweenMethods.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/formatter/blankLineBetweenMethods.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class C:
def foo(self):
pass
def bar(self):
pass | 14.4 | 18 | 0.472222 | class C:
def foo(self):
pass
def bar(self):
pass | true | true |
1c072fdb1298e1cd95312a798b753d7372fcce02 | 19,373 | py | Python | pytype/tests/test_attr1.py | nikitt-code/pytype | fb6e87ca27fc2239799a8ea9e205d6e8efea49d2 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_attr1.py | nikitt-code/pytype | fb6e87ca27fc2239799a8ea9e205d6e8efea49d2 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_attr1.py | nikitt-code/pytype | fb6e87ca27fc2239799a8ea9e205d6e8efea49d2 | [
"Apache-2.0"
] | null | null | null | """Tests for attrs library in attr_overlay.py."""
from pytype.tests import test_base
class TestAttrib(test_base.BaseTest):
"""Tests for attr.ib."""
def test_basic(self):
ty = self.Infer("""
import attr
@attr.s
class Foo:
x = attr.ib()
y = attr.ib(type=int)
z = attr.... | 23.976485 | 81 | 0.516698 |
from pytype.tests import test_base
class TestAttrib(test_base.BaseTest):
def test_basic(self):
ty = self.Infer("""
import attr
@attr.s
class Foo:
x = attr.ib()
y = attr.ib(type=int)
z = attr.ib(type=str)
""")
self.assertTypesMatchPytd(ty, """
from typing... | true | true |
1c07309e887daa5b863f3d66559596ce2e250c9a | 1,502 | py | Python | membrane_lowpass_md.py | ricardodeazambuja/IJCNN2017-2 | 51b26f81b9137b368ff93d446485ac9b85f6854c | [
"MIT"
] | 4 | 2019-10-27T10:38:05.000Z | 2021-03-23T12:36:15.000Z | membrane_lowpass_md.py | ricardodeazambuja/IJCNN2017-2 | 51b26f81b9137b368ff93d446485ac9b85f6854c | [
"MIT"
] | 1 | 2021-01-18T06:06:02.000Z | 2021-01-18T09:39:56.000Z | membrane_lowpass_md.py | ricardodeazambuja/IJCNN2017 | 817165185de6152041bbaf21cbad6d12fb58f064 | [
"MIT"
] | 1 | 2017-07-19T23:51:25.000Z | 2017-07-19T23:51:25.000Z |
import numpy
class membrane_lowpass(object):
def __init__(self, Number_of_Neurons, tau):
'''
Initializes the neuron membranes.
Number_of_Neurons: total number of neurons to be simulated
tau: time constant (in seconds)
'''
self.neurons = numpy.zeros(Number_of_Ne... | 44.176471 | 111 | 0.67976 |
import numpy
class membrane_lowpass(object):
def __init__(self, Number_of_Neurons, tau):
self.neurons = numpy.zeros(Number_of_Neurons)
self.times = numpy.zeros(Number_of_Neurons)
self.tau = tau
def process_spikes(self, spikes, current_time):
delta_t = current_time-sel... | true | true |
1c0730f7572232132a4d4740d8db71c86d2fd158 | 866 | py | Python | DouBan_Movie_TOP250/DouBan/settings.py | WiseDoge/Spider_Hub | 64ce12159433263deb0f6b35e19f1762d62390ab | [
"Apache-2.0"
] | 63 | 2016-11-13T10:16:24.000Z | 2019-11-25T00:16:20.000Z | DouBan_Movie_TOP250/DouBan/settings.py | WiseDoge/Spider_Hub | 64ce12159433263deb0f6b35e19f1762d62390ab | [
"Apache-2.0"
] | null | null | null | DouBan_Movie_TOP250/DouBan/settings.py | WiseDoge/Spider_Hub | 64ce12159433263deb0f6b35e19f1762d62390ab | [
"Apache-2.0"
] | 30 | 2017-06-17T11:37:46.000Z | 2020-02-07T19:26:01.000Z | # -*- coding: utf-8 -*-
# Scrapy settings for DouBan project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/... | 26.242424 | 125 | 0.743649 |
BOT_NAME = 'DouBan'
SPIDER_MODULES = ['DouBan.spiders']
NEWSPIDER_MODULE = 'DouBan.spiders'
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36'
ROBOTSTXT_OBEY = True
COOKIES_ENABLED = True
MONGODB_HOST = '127.0.0.1'
MONGODB_PORT = 27017
MONG... | true | true |
1c0732ca9233e5a92d1eca7dbfbd5ee7c55f4f14 | 2,311 | py | Python | 922_tune_learning_rate.py | huotarim/huotarim-xgboost-li-ion-batteries | a5c183be35aab4bd86924913d37d0ec7bc3a4220 | [
"CC-BY-4.0"
] | null | null | null | 922_tune_learning_rate.py | huotarim/huotarim-xgboost-li-ion-batteries | a5c183be35aab4bd86924913d37d0ec7bc3a4220 | [
"CC-BY-4.0"
] | 1 | 2020-08-18T13:42:52.000Z | 2020-08-18T13:42:52.000Z | 922_tune_learning_rate.py | huotarim/huotarim-xgboost-li-ion-batteries | a5c183be35aab4bd86924913d37d0ec7bc3a4220 | [
"CC-BY-4.0"
] | 2 | 2021-02-23T09:00:57.000Z | 2022-03-16T03:21:58.000Z | # battery 023, parallel cross validation
from pandas import read_csv
from sklearn.model_selection import train_test_split
from xgboost import XGBRegressor
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import TimeSeriesSplit
import matplotlib
matplotlib.use('Agg')
from matplotlib import p... | 39.169492 | 108 | 0.773258 | from pandas import read_csv
from sklearn.model_selection import train_test_split
from xgboost import XGBRegressor
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import TimeSeriesSplit
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot
import numpy
DIR = './'
FILE = 'ho... | true | true |
1c0732f8b4511103d424792aef5f87919030978e | 2,476 | py | Python | apps/storm/tasks.py | Iamacode/blog | a679cc25b89dde548a7668e291af9c5d14530bdb | [
"Apache-2.0"
] | null | null | null | apps/storm/tasks.py | Iamacode/blog | a679cc25b89dde548a7668e291af9c5d14530bdb | [
"Apache-2.0"
] | 8 | 2020-06-06T00:57:59.000Z | 2022-01-13T02:26:12.000Z | apps/storm/tasks.py | Iamacode/blog | a679cc25b89dde548a7668e291af9c5d14530bdb | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
__project_ = 'blog'
__file_name__ = 'tasks'
__author__ = 'admin'
__time__ = '2020-04-13 11:20'
__product_name = PyCharm
"""
import platform
from celery import shared_task
import re
import json
# 词频统计库
import collections
import numpy as np
import jieba
import wordcloud
from PIL import Image
from bl... | 28.790698 | 117 | 0.63853 | import platform
from celery import shared_task
import re
import json
import collections
import numpy as np
import jieba
import wordcloud
from PIL import Image
from blog.settings import STATICFILES_DIRS, WINDOWS_FONT_PATH, UBUNTU_FONT_PATH
from storm.models import Article
@shared_task
def word_cloud_handle():
pr... | true | true |
1c073324173b3b7fadf7f07311f27789079b500f | 5,376 | py | Python | Python/example_controllers/flex_fluid_object.py | felixbinder/tdw | eb2b00b74b9fcf8ef2dcba1baa62424640c520b1 | [
"BSD-2-Clause"
] | 307 | 2020-05-20T18:08:49.000Z | 2022-03-21T19:55:08.000Z | Python/example_controllers/flex_fluid_object.py | felixbinder/tdw | eb2b00b74b9fcf8ef2dcba1baa62424640c520b1 | [
"BSD-2-Clause"
] | 92 | 2020-07-21T18:29:13.000Z | 2022-03-28T07:25:54.000Z | Python/example_controllers/flex_fluid_object.py | felixbinder/tdw | eb2b00b74b9fcf8ef2dcba1baa62424640c520b1 | [
"BSD-2-Clause"
] | 53 | 2020-07-14T15:55:17.000Z | 2022-03-20T16:20:01.000Z | from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from time import sleep
from platform import system
"""
Create a fluid "container" with the NVIDIA Flex physics engine. Run several trials, dropping ball objects of increasing mass into the fluid.
"""
class FlexFluid(Controller):
... | 49.321101 | 219 | 0.509301 | from tdw.controller import Controller
from tdw.tdw_utils import TDWUtils
from time import sleep
from platform import system
class FlexFluid(Controller):
def run(self):
if system() != "Windows":
raise Exception("Flex fluids are only supported in Windows (see Documentation/misc_fron... | true | true |
1c073530755861aa024002c851c426f7151ed789 | 183 | py | Python | src/femtomes_ros_driver/mapping.py | DapengFeng/femtomes_ros_driver | 960dd09e753d4821e966d7eddefdf0df1bf35b55 | [
"Apache-2.0"
] | null | null | null | src/femtomes_ros_driver/mapping.py | DapengFeng/femtomes_ros_driver | 960dd09e753d4821e966d7eddefdf0df1bf35b55 | [
"Apache-2.0"
] | null | null | null | src/femtomes_ros_driver/mapping.py | DapengFeng/femtomes_ros_driver | 960dd09e753d4821e966d7eddefdf0df1bf35b55 | [
"Apache-2.0"
] | null | null | null | from femtomes_ros_driver.msg import FemtomesBESTXYZ
from femtomes_ros_driver.msg import FemtomesHEADING
msgs = {241: ("bestxyz", FemtomesBESTXYZ), 971: ("heading", FemtomesHEADING)}
| 36.6 | 77 | 0.808743 | from femtomes_ros_driver.msg import FemtomesBESTXYZ
from femtomes_ros_driver.msg import FemtomesHEADING
msgs = {241: ("bestxyz", FemtomesBESTXYZ), 971: ("heading", FemtomesHEADING)}
| true | true |
1c07357d56b780a40cb0329261c97dd4e178d4bf | 12,521 | py | Python | qa/rpc-tests/smartfees.py | mirzaei-ce/core-kakobit | 82912c3843f5b7c2e2bc27ed4e22a54062d9a356 | [
"MIT"
] | null | null | null | qa/rpc-tests/smartfees.py | mirzaei-ce/core-kakobit | 82912c3843f5b7c2e2bc27ed4e22a54062d9a356 | [
"MIT"
] | null | null | null | qa/rpc-tests/smartfees.py | mirzaei-ce/core-kakobit | 82912c3843f5b7c2e2bc27ed4e22a54062d9a356 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test fee estimation code
#
from test_framework.test_framework import KakobitTestFramework
from test_... | 47.42803 | 110 | 0.642281 |
from test_framework.test_framework import KakobitTestFramework
from test_framework.util import *
# So we can create many many transactions without needing to spend
# time signing.
P2SH_1 = "2MySexEGVzZpRgNQ1JdjdP5bRETznm3roQ2" # P2SH of "OP_1 OP_DROP"
P2SH_2 = "2NBdpwq8Aoo1EEKEXPNrKvr5xQr3M9UfcZA" # P2SH of "OP_2 OP... | true | true |
1c0735e0fdc78b61a7e01d5b1c6ad8901efb87b2 | 80 | py | Python | minuet/__init__.py | lzfelix/minuet | 7b662cff0c188eb847c271273ec507ac56c1c0af | [
"MIT"
] | 9 | 2018-07-10T01:59:41.000Z | 2020-05-30T12:32:23.000Z | minuet/__init__.py | lzfelix/minuet | 7b662cff0c188eb847c271273ec507ac56c1c0af | [
"MIT"
] | 5 | 2020-11-13T17:54:34.000Z | 2022-02-09T23:46:36.000Z | minuet/__init__.py | lzfelix/minuet | 7b662cff0c188eb847c271273ec507ac56c1c0af | [
"MIT"
] | 2 | 2019-02-24T02:24:18.000Z | 2019-02-26T18:48:52.000Z | from minuet.minuet import Minuet
from minuet.minuet import CharEmbeddingConfigs
| 26.666667 | 46 | 0.875 | from minuet.minuet import Minuet
from minuet.minuet import CharEmbeddingConfigs
| true | true |
1c0736382cbdeaf02ed4513267851311f7b98347 | 5,000 | py | Python | single/firm.py | asuberlin/price_wage_dynamics | 06ac51fa0b3ad7f1bb3e81540354b8aea866a693 | [
"MIT"
] | null | null | null | single/firm.py | asuberlin/price_wage_dynamics | 06ac51fa0b3ad7f1bb3e81540354b8aea866a693 | [
"MIT"
] | null | null | null | single/firm.py | asuberlin/price_wage_dynamics | 06ac51fa0b3ad7f1bb3e81540354b8aea866a693 | [
"MIT"
] | null | null | null | from scipy.optimize import minimize, minimize_scalar, basinhopping, curve_fit
import numpy as np
class Firm:
def __init__(self, money, firmParameters, p_star, S_star, L_star, z_star, expectation):
self.gamma = firmParameters['gamma']
self.p_t = p_star
self.zeta_0 = firmParameters['zeta_0']
... | 51.020408 | 176 | 0.5988 | from scipy.optimize import minimize, minimize_scalar, basinhopping, curve_fit
import numpy as np
class Firm:
def __init__(self, money, firmParameters, p_star, S_star, L_star, z_star, expectation):
self.gamma = firmParameters['gamma']
self.p_t = p_star
self.zeta_0 = firmParameters['zeta_0']
... | true | true |
1c07371a20476551a5755918223c175b02730703 | 862 | py | Python | src/main.py | tiborizsak/StatusSearch | bdf01cc154805e2364856c9b690225810f4587fc | [
"MIT"
] | null | null | null | src/main.py | tiborizsak/StatusSearch | bdf01cc154805e2364856c9b690225810f4587fc | [
"MIT"
] | null | null | null | src/main.py | tiborizsak/StatusSearch | bdf01cc154805e2364856c9b690225810f4587fc | [
"MIT"
] | null | null | null | from pkgproc import Uzip, Cuttree
from statussearch import Filepath, Findstatus, EnhancedFilepath, globsearch
directory = 'T:\\T\\IWP\\py\\StatusSearch_archive\\DatArc\\'
extension = '.dat'
tocutdst = '\\C\\DatArc\\'
toplacedst = '\\DatArc\\'
outputlist = '\\StatusSearch_archive\\DatArc\\'
statusdivfullre = r'CI01:(3... | 28.733333 | 86 | 0.721578 | from pkgproc import Uzip, Cuttree
from statussearch import Filepath, Findstatus, EnhancedFilepath, globsearch
directory = 'T:\\T\\IWP\\py\\StatusSearch_archive\\DatArc\\'
extension = '.dat'
tocutdst = '\\C\\DatArc\\'
toplacedst = '\\DatArc\\'
outputlist = '\\StatusSearch_archive\\DatArc\\'
statusdivfullre = r'CI01:(3... | true | true |
1c07372a1e4d7f2927dfb555717d72bc81c61cac | 11,076 | py | Python | metrics/arcface_resnet.py | affromero/SMILE | 931510d69b2e33f2fe633563833c50a7408f89ef | [
"MIT"
] | 20 | 2020-10-07T15:44:38.000Z | 2022-02-25T10:08:22.000Z | metrics/arcface_resnet.py | affromero/SMILE | 931510d69b2e33f2fe633563833c50a7408f89ef | [
"MIT"
] | 1 | 2022-03-11T03:19:14.000Z | 2022-03-11T03:53:59.000Z | metrics/arcface_resnet.py | affromero/SMILE | 931510d69b2e33f2fe633563833c50a7408f89ef | [
"MIT"
] | 1 | 2021-11-03T11:15:52.000Z | 2021-11-03T11:15:52.000Z | # -*- coding: utf-8 -*-
"""
Created on 18-5-21 下午5:26
@author: ronghuaiyang
"""
import torch
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch.nn.utils.weight_norm as weight_norm
import torch.nn.functional as F
# https://github.com/ronghuaiyang/arcface-pytorch
# __all__ = ['Res... | 32.197674 | 91 | 0.590105 | import torch
import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch.nn.utils.weight_norm as weight_norm
import torch.nn.functional as F
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/r... | true | true |
1c07379de8cfac4f99eb0df95c1c798070f7b3b2 | 2,137 | py | Python | pre_commit_hooks/end_of_file_fixer.py | christhekeele/pre-commit-hooks | 2f7e22dc211ddec22670778553b91850a4ba8c1f | [
"MIT"
] | 3 | 2020-03-16T11:04:15.000Z | 2020-10-19T19:37:54.000Z | pre_commit_hooks/end_of_file_fixer.py | christhekeele/pre-commit-hooks | 2f7e22dc211ddec22670778553b91850a4ba8c1f | [
"MIT"
] | null | null | null | pre_commit_hooks/end_of_file_fixer.py | christhekeele/pre-commit-hooks | 2f7e22dc211ddec22670778553b91850a4ba8c1f | [
"MIT"
] | 4 | 2021-06-03T09:56:50.000Z | 2022-03-17T09:48:29.000Z | import argparse
import os
from typing import IO
from typing import Optional
from typing import Sequence
def fix_file(file_obj: IO[bytes]) -> int:
# Test for newline at end of file
# Empty files will throw IOError here
try:
file_obj.seek(-1, os.SEEK_END)
except OSError:
return 0
las... | 30.098592 | 78 | 0.613945 | import argparse
import os
from typing import IO
from typing import Optional
from typing import Sequence
def fix_file(file_obj: IO[bytes]) -> int:
try:
file_obj.seek(-1, os.SEEK_END)
except OSError:
return 0
last_character = file_obj.read(1)
if last_character not in {b'\n', ... | true | true |
1c07399cf71bf89ac2841f675526cce0ad63c4f6 | 269 | py | Python | learn-to-code-with-python/08-Control-Flow/a-brief-intro-to-recursion.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/08-Control-Flow/a-brief-intro-to-recursion.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | learn-to-code-with-python/08-Control-Flow/a-brief-intro-to-recursion.py | MaciejZurek/python_practicing | 0a426f2aed151573e1f8678e0239ff596d92bbde | [
"MIT"
] | null | null | null | # def countdown_from(number):
# start = number
# while start > 0:
# print(start)
# start -= 1
# countdown_from(5)
def countdown_from(number):
if number <= 0:
return
print(number)
countdown_from(number - 1)
countdown_from(5) | 19.214286 | 30 | 0.598513 |
def countdown_from(number):
if number <= 0:
return
print(number)
countdown_from(number - 1)
countdown_from(5) | true | true |
1c073b275a40cc8ce1a3940e2e550e192fdc5305 | 126 | py | Python | python/testData/resolve/UnboundVariableOnClassLevelDeclaredBelowAsTarget.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/resolve/UnboundVariableOnClassLevelDeclaredBelowAsTarget.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/resolve/UnboundVariableOnClassLevelDeclaredBelowAsTarget.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | foo = 'global'
def method(foo):
class A:
print(foo)
# <ref>
foo = 'local'
print(foo) | 15.75 | 21 | 0.428571 | foo = 'global'
def method(foo):
class A:
print(foo)
foo = 'local'
print(foo) | true | true |
1c073b4129e7d87c4d86197de8e583eb55e50110 | 437 | py | Python | tutorial-reference/Day 27/sync.py | LilianaArguello/30-Days-of-Python | 587feb0a2290043e312215d7971871a6c45b5ab5 | [
"MIT"
] | 2,044 | 2016-03-11T02:56:41.000Z | 2022-03-29T16:34:58.000Z | tutorial-reference/Day 27/sync.py | Tems-py/30-Days-of-Python | 08316996be7c55efd56036209907568a238c26fc | [
"MIT"
] | 28 | 2016-12-26T10:51:08.000Z | 2021-12-13T20:49:47.000Z | tutorial-reference/Day 27/sync.py | Tems-py/30-Days-of-Python | 08316996be7c55efd56036209907568a238c26fc | [
"MIT"
] | 1,448 | 2016-03-12T04:44:06.000Z | 2022-03-28T11:43:45.000Z | # cfe.sh/github -> 30 Day of Python -> Day 27
import time
iteration_times = [1, 3, 2, 4]
def sleeper(seconds, i=-1):
start_time = time.time()
if i != -1:
print(f"{i}\t{seconds}s")
time.sleep(seconds)
return time.time() - start_time
run_time = 0
def main():
global run_time
for i, secon... | 23 | 48 | 0.629291 | import time
iteration_times = [1, 3, 2, 4]
def sleeper(seconds, i=-1):
start_time = time.time()
if i != -1:
print(f"{i}\t{seconds}s")
time.sleep(seconds)
return time.time() - start_time
run_time = 0
def main():
global run_time
for i, second in enumerate(iteration_times):
run_t... | true | true |
1c073bb48a21c0f8622cc2f5823f711dfdd29150 | 3,405 | py | Python | mars/optimization/physical/tests/test_numexpr.py | haijohn/mars | 672b3a33a70565f01b1a3f508908445491d85acf | [
"Apache-2.0"
] | 1 | 2021-11-30T12:07:21.000Z | 2021-11-30T12:07:21.000Z | mars/optimization/physical/tests/test_numexpr.py | JeffroMF/mars | 2805241ac55b50c4f6319baa41113fbf8c723832 | [
"Apache-2.0"
] | null | null | null | mars/optimization/physical/tests/test_numexpr.py | JeffroMF/mars | 2805241ac55b50c4f6319baa41113fbf8c723832 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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... | 37.01087 | 76 | 0.598532 |
from ....core import ChunkGraph
from ....tensor.arithmetic import TensorTreeAdd
from ....tensor.indexing import TensorSlice
from ..numexpr import NumexprRuntimeOptimizer
def test_numexpr():
chunks = [TensorTreeAdd(args=[], _key=str(n)).new_chunk(None, None).data
for n in range(6)]
chunk_slice =... | true | true |
1c073ca383f7e28cfd093ca42b09b7f426a5fac8 | 7,739 | py | Python | tests/view/api/test_views.py | mbeko/moztrap | db75e1f8756ef2c0c39652a66302b19c8afa0256 | [
"BSD-2-Clause"
] | null | null | null | tests/view/api/test_views.py | mbeko/moztrap | db75e1f8756ef2c0c39652a66302b19c8afa0256 | [
"BSD-2-Clause"
] | null | null | null | tests/view/api/test_views.py | mbeko/moztrap | db75e1f8756ef2c0c39652a66302b19c8afa0256 | [
"BSD-2-Clause"
] | null | null | null | """
Tests for home speedy API views.
"""
import json
from django.core.urlresolvers import reverse
from tests import case
class SpeedyCaseVersionsViewTest(case.view.ViewTestCase):
"""Tests for speedy caseversions API view."""
@property
def url(self):
return reverse("caseselection")
def tes... | 30.11284 | 79 | 0.502907 | import json
from django.core.urlresolvers import reverse
from tests import case
class SpeedyCaseVersionsViewTest(case.view.ViewTestCase):
@property
def url(self):
return reverse("caseselection")
def test_that_productversion__product_is_required(self):
res = self.get(status=400)
... | true | true |
1c073cf8aa69a6ef2fbd35497f63d32dcb9275b8 | 423 | py | Python | apps/sushi/migrations/0050_alter_sushicredentials_api_key.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | 1 | 2019-12-12T15:38:42.000Z | 2019-12-12T15:38:42.000Z | apps/sushi/migrations/0050_alter_sushicredentials_api_key.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | apps/sushi/migrations/0050_alter_sushicredentials_api_key.py | techlib/czechelib-stats | ca132e326af0924740a525710474870b1fb5fd37 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-04-11 07:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sushi', '0049_sushifetchattempt_extracted_data'),
]
operations = [
migrations.AlterField(
model_name='sushicredentials',
... | 22.263158 | 63 | 0.626478 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sushi', '0049_sushifetchattempt_extracted_data'),
]
operations = [
migrations.AlterField(
model_name='sushicredentials',
name='api_key',
field=models.Ch... | true | true |
1c073d56c94a1d9fc24a2d2c49cb71f749e9a205 | 5,851 | py | Python | src/lib/ModelPrune/demo01.py | zengjie617789/FairMOT-TRT | 06d2a9a7da92f6da6b8c8081b41cca58c1950eda | [
"MIT"
] | 1 | 2022-02-19T12:33:38.000Z | 2022-02-19T12:33:38.000Z | src/lib/ModelPrune/demo01.py | zengjie617789/FairMOT-TRT | 06d2a9a7da92f6da6b8c8081b41cca58c1950eda | [
"MIT"
] | null | null | null | src/lib/ModelPrune/demo01.py | zengjie617789/FairMOT-TRT | 06d2a9a7da92f6da6b8c8081b41cca58c1950eda | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
'''
NNI example for quick start of pruning.
In this example, we use level pruner to prune the LeNet on MNIST.
'''
import logging
import argparse
import torch
import torch.nn.functional as F
import torch.optim as optim
from torchvision import da... | 37.267516 | 100 | 0.627927 |
import logging
import argparse
import torch
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from nni.algorithms.compression.pytorch.pruning import LevelPruner
import sys
sys.path.append('../models')
from mnist.len... | true | true |
1c073d575249e6f524c3e4fa1ac84edb0ff05cc7 | 984 | py | Python | UAS/UAS 11 & 12/main.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | UAS/UAS 11 & 12/main.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | UAS/UAS 11 & 12/main.py | Archedar/UAS | 3237d9304026340acc93c8f36b358578dc0ae66f | [
"BSD-Source-Code"
] | null | null | null | #Main Program
from Class import Barang
import Menu
histori = list()
listBarang = [
Barang('Rinso', 5000, 20),
Barang('Sabun', 3000, 20),
Barang('Pulpen', 2500, 20),
Barang('Tisu', 10000, 20),
Barang('Penggaris', 1000, 20)
]
while True:
print('''
Menu
1. Tampilkan Barang
2. Tambahkan Barang
3. Ta... | 20.93617 | 37 | 0.645325 | from Class import Barang
import Menu
histori = list()
listBarang = [
Barang('Rinso', 5000, 20),
Barang('Sabun', 3000, 20),
Barang('Pulpen', 2500, 20),
Barang('Tisu', 10000, 20),
Barang('Penggaris', 1000, 20)
]
while True:
print('''
Menu
1. Tampilkan Barang
2. Tambahkan Barang
3. Tambah Stock Bara... | true | true |
1c073fc4252da06c653bbf85cb9ed9e8d12d1ad7 | 2,235 | py | Python | backend/katarasa_pos_32154/urls.py | crowdbotics-apps/katarasa-pos-32154 | 8f4749e65af748cf27cf42cd6964d8791033837e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/katarasa_pos_32154/urls.py | crowdbotics-apps/katarasa-pos-32154 | 8f4749e65af748cf27cf42cd6964d8791033837e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/katarasa_pos_32154/urls.py | crowdbotics-apps/katarasa-pos-32154 | 8f4749e65af748cf27cf42cd6964d8791033837e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """katarasa_pos_32154 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 35.47619 | 87 | 0.713199 |
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic.base import TemplateView
from allauth.account.views import confirm_email
from rest_framework import permissions
from drf_yasg.views import get_schema_view
from drf_yasg import openapi
urlpatterns = [
path("",... | true | true |
1c07402a830d9cc2ef7cfb91b2902ee7cb4b331b | 4,403 | py | Python | chia/cmds/keys_funcs.py | 13thProgression/lucky-blockchain | ba9ecc990aa8ed630aff4ce59c2b0f127786fdb8 | [
"Apache-2.0"
] | 11 | 2021-08-14T15:46:18.000Z | 2022-02-09T04:29:53.000Z | chia/cmds/keys_funcs.py | 13thProgression/lucky-blockchain | ba9ecc990aa8ed630aff4ce59c2b0f127786fdb8 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:48:11.000Z | 2021-11-19T22:50:39.000Z | chia/cmds/keys_funcs.py | 13thProgression/lucky-blockchain | ba9ecc990aa8ed630aff4ce59c2b0f127786fdb8 | [
"Apache-2.0"
] | 6 | 2021-08-19T13:27:46.000Z | 2022-03-15T08:37:56.000Z | from typing import List
from blspy import AugSchemeMPL, G1Element, G2Element
from chia.consensus.coinbase import create_puzzlehash_for_pk
from chia.util.bech32m import encode_puzzle_hash
from chia.util.config import load_config
from chia.util.default_root import DEFAULT_ROOT_PATH
from chia.util.ints import uint32
fro... | 34.398438 | 113 | 0.669998 | from typing import List
from blspy import AugSchemeMPL, G1Element, G2Element
from chia.consensus.coinbase import create_puzzlehash_for_pk
from chia.util.bech32m import encode_puzzle_hash
from chia.util.config import load_config
from chia.util.default_root import DEFAULT_ROOT_PATH
from chia.util.ints import uint32
fro... | true | true |
1c074197be36c51a9717f2cc1010e2c1d31a6ad6 | 18,031 | py | Python | test/pathod/protocols/test_http2.py | ravitejavalluri/mproxy | ccd8e1e617cdbf3b34ec01ac130093396197101f | [
"MIT"
] | 1 | 2017-05-11T18:15:52.000Z | 2017-05-11T18:15:52.000Z | test/pathod/protocols/test_http2.py | ravitejavalluri/mproxy | ccd8e1e617cdbf3b34ec01ac130093396197101f | [
"MIT"
] | 1 | 2021-05-09T11:18:14.000Z | 2021-05-09T11:18:14.000Z | test/pathod/protocols/test_http2.py | ravitejavalluri/mproxy | ccd8e1e617cdbf3b34ec01ac130093396197101f | [
"MIT"
] | 1 | 2021-11-09T15:18:50.000Z | 2021-11-09T15:18:50.000Z | from unittest import mock
import codecs
import pytest
import hyperframe
from mitmproxy.net import tcp, http
from mitmproxy.net.http import http2
from mitmproxy import exceptions
from ...mitmproxy.net import tservers as net_tservers
from pathod.protocols.http2 import HTTP2StateProtocol, TCPHandler
from ...conftest i... | 35.01165 | 115 | 0.626532 | from unittest import mock
import codecs
import pytest
import hyperframe
from mitmproxy.net import tcp, http
from mitmproxy.net.http import http2
from mitmproxy import exceptions
from ...mitmproxy.net import tservers as net_tservers
from pathod.protocols.http2 import HTTP2StateProtocol, TCPHandler
from ...conftest i... | true | true |
1c0741e552db6bf873eb00b369e87a2c9f2fd701 | 72 | py | Python | Curso de Cisco/Actividades/El ciclo for y la rama else - parte 2.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/El ciclo for y la rama else - parte 2.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | Curso de Cisco/Actividades/El ciclo for y la rama else - parte 2.py | tomasfriz/Curso-de-Cisco | a50ee5fa96bd86d468403e29ccdc3565a181af60 | [
"MIT"
] | null | null | null | i = 111
for i in range(2, 1):
print(i)
else:
print("else:", i) | 14.4 | 22 | 0.513889 | i = 111
for i in range(2, 1):
print(i)
else:
print("else:", i) | false | true |
1c0743a771b0875d3ef6018e5f87cddecf6c6ebf | 4,086 | py | Python | keystone_tempest_plugin/tests/api/identity/v3/test_mapping_rules.py | ilay09/keystone | e45049dfd46ab7d3e4c6aa48a3046f622f4a3b1e | [
"Apache-2.0"
] | null | null | null | keystone_tempest_plugin/tests/api/identity/v3/test_mapping_rules.py | ilay09/keystone | e45049dfd46ab7d3e4c6aa48a3046f622f4a3b1e | [
"Apache-2.0"
] | 1 | 2019-08-18T09:25:49.000Z | 2019-08-18T09:25:49.000Z | keystone_tempest_plugin/tests/api/identity/v3/test_mapping_rules.py | ilay09/keystone | e45049dfd46ab7d3e4c6aa48a3046f622f4a3b1e | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 39.288462 | 77 | 0.70558 |
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from tempest import test
from keystone_tempest_plugin.tests.api.identity.v3 import fixtures
from keystone_tempest_plugin.tests import base
class MappingRulesTest(base.BaseIdentityTest):
... | true | true |
1c0744d23a4a4e2d0ed694abdc9dfdc7fa4e914a | 2,778 | py | Python | pip/commands/completion.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | pip/commands/completion.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | null | null | null | pip/commands/completion.py | lyw07/kolibripip | e7039eca92b61827faa754311f1489e89a11519d | [
"MIT"
] | 1 | 2020-12-18T10:39:35.000Z | 2020-12-18T10:39:35.000Z | from __future__ import absolute_import
import sys
import textwrap
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="$... | 30.866667 | 79 | 0.537077 | from __future__ import absolute_import
import sys
import textwrap
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="$... | true | true |
1c0745d4cef2002d88a6c0bc4d265a1e03b6a8de | 795 | py | Python | newpost.py | sunglim/sunglim.github.io | 760ea5185ec41b5d9fdcc99bfec14111bc0b8d37 | [
"Apache-2.0"
] | null | null | null | newpost.py | sunglim/sunglim.github.io | 760ea5185ec41b5d9fdcc99bfec14111bc0b8d37 | [
"Apache-2.0"
] | 1 | 2020-03-04T09:45:24.000Z | 2020-03-04T09:45:24.000Z | newpost.py | sunglim/sunglim.github.io | 760ea5185ec41b5d9fdcc99bfec14111bc0b8d37 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
assert __name__ == '__main__'
import imp
import os
import pipes
import subprocess
import sys
from datetime import date
import datetime
from datetime import datetime
from datetime import time, tzinfo, timedelta
import time
#date: 2019-12-17 20:00:35 +0900
def main():
today = date.today()
... | 17.666667 | 56 | 0.656604 |
assert __name__ == '__main__'
import imp
import os
import pipes
import subprocess
import sys
from datetime import date
import datetime
from datetime import datetime
from datetime import time, tzinfo, timedelta
import time
def main():
today = date.today()
formated_today = today.strftime("%Y-%m-%d")
... | true | true |
1c07469cf9f51449193969755776bda1eecf0dd4 | 3,068 | py | Python | backend/backend/settings.py | adamA113/My-Portfolio | bca6e5144e909506a5c318bba356a0579ce6e0ed | [
"MIT"
] | null | null | null | backend/backend/settings.py | adamA113/My-Portfolio | bca6e5144e909506a5c318bba356a0579ce6e0ed | [
"MIT"
] | null | null | null | backend/backend/settings.py | adamA113/My-Portfolio | bca6e5144e909506a5c318bba356a0579ce6e0ed | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 3.1.4.
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... | 25.355372 | 91 | 0.696219 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'e_83*h@cqqb1qmn#zw044pbj9#$_rh(q&3o%!uh=%h30o____3'
DEBUG = True
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
... | true | true |
1c0746a312e1f8995dbc142fba2e28a4e56504d2 | 982 | py | Python | tests/juce_rsa_test.py | sevangelatos/juce_rsa | 637d7dec106602ef10493e398dc27f3cdf19529b | [
"MIT"
] | 1 | 2020-09-29T07:00:30.000Z | 2020-09-29T07:00:30.000Z | tests/juce_rsa_test.py | sevangelatos/juce_rsa | 637d7dec106602ef10493e398dc27f3cdf19529b | [
"MIT"
] | null | null | null | tests/juce_rsa_test.py | sevangelatos/juce_rsa | 637d7dec106602ef10493e398dc27f3cdf19529b | [
"MIT"
] | 1 | 2021-06-02T12:43:04.000Z | 2021-06-02T12:43:04.000Z | #!/usr/bin/env python3
import unittest
import juce_rsa
class TestJuceRsaMethods(unittest.TestCase):
def test_instantiate(self):
key1 = juce_rsa.RSAKey()
key2 = juce_rsa.RSAKey("deadbeef, 12345")
key3 = repr(key2)
def test_repr(self):
key2 = juce_rsa.RSAKey("deadbeef, 12345")
... | 28.882353 | 66 | 0.64053 | import unittest
import juce_rsa
class TestJuceRsaMethods(unittest.TestCase):
def test_instantiate(self):
key1 = juce_rsa.RSAKey()
key2 = juce_rsa.RSAKey("deadbeef, 12345")
key3 = repr(key2)
def test_repr(self):
key2 = juce_rsa.RSAKey("deadbeef, 12345")
self.assertTrue(... | true | true |
1c0746bc15867f92bf9bc1489f0ac57252760956 | 583 | py | Python | test/test_env.py | ropiens/project-sandwich-man | bd0b149363ad8be2176be2965241228fb05077b4 | [
"MIT"
] | 5 | 2021-07-29T07:22:06.000Z | 2021-08-30T14:01:35.000Z | test/test_env.py | ropiens/project-sandwich-man | bd0b149363ad8be2176be2965241228fb05077b4 | [
"MIT"
] | 19 | 2021-07-29T06:57:42.000Z | 2021-11-19T04:11:25.000Z | test/test_env.py | ropiens/project-sandwich-man | bd0b149363ad8be2176be2965241228fb05077b4 | [
"MIT"
] | null | null | null | import os
import gym
import panda_gym
def test():
"""test panda-gym environment"""
env = gym.make("PandaStack-v1", render=True)
p = env.sim.physics_client
path = os.path.abspath(os.path.join(__file__, "../.."))
p.loadURDF(
f"{path}/ropiens/ropiens.urdf",
[-0.2, 0.9, 0.3],
... | 18.21875 | 59 | 0.552316 | import os
import gym
import panda_gym
def test():
env = gym.make("PandaStack-v1", render=True)
p = env.sim.physics_client
path = os.path.abspath(os.path.join(__file__, "../.."))
p.loadURDF(
f"{path}/ropiens/ropiens.urdf",
[-0.2, 0.9, 0.3],
[0.5, 0.5, 0.5, 0.5],
global... | true | true |
1c07476ceccb2367d3bc089af313bb54d93785d9 | 2,301 | py | Python | py/cora/sag_inference/dgl_.py | tekdogan/gcn | 068c79905f31c052270a70febe4e928067940562 | [
"MIT"
] | 6 | 2020-08-27T11:33:30.000Z | 2022-01-05T06:22:02.000Z | py/cora/sag_inference/dgl_.py | tekdogan/gcn | 068c79905f31c052270a70febe4e928067940562 | [
"MIT"
] | null | null | null | py/cora/sag_inference/dgl_.py | tekdogan/gcn | 068c79905f31c052270a70febe4e928067940562 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import dgl
import dgl.function as fn
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl import DGLGraph
import sys
import torch.cuda.profiler as profiler
import pyprof
import dgl.data as da
from dgl.nn import SAGEConv
pyprof.init()
with torch.autograd.profiler.emit_nvtx... | 27.070588 | 75 | 0.615819 | import dgl
import dgl.function as fn
import torch
import torch.nn as nn
import torch.nn.functional as F
from dgl import DGLGraph
import sys
import torch.cuda.profiler as profiler
import pyprof
import dgl.data as da
from dgl.nn import SAGEConv
pyprof.init()
with torch.autograd.profiler.emit_nvtx():
profiler.start... | true | true |
1c0747deaa9f3aecabae99d9f9e57eb7dc8c8d22 | 18,335 | py | Python | camkes/templates/macros.py | maybe-sybr/camkes-tool | a45bbc70780e25c7b16c8570910040c68a5934f3 | [
"BSD-2-Clause"
] | null | null | null | camkes/templates/macros.py | maybe-sybr/camkes-tool | a45bbc70780e25c7b16c8570910040c68a5934f3 | [
"BSD-2-Clause"
] | null | null | null | camkes/templates/macros.py | maybe-sybr/camkes-tool | a45bbc70780e25c7b16c8570910040c68a5934f3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE... | 34.20709 | 120 | 0.648377 |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from camkes.internal.seven import cmp, filter, map, zip
from camkes.ast import Composition, Instance, Parameter, Struct
from camkes.templates import sizeof_probe, TemplateError
from capdl import ASIDPool, CNode, Endpoint, Frame... | true | true |
1c07492373ba7f0ec080bd295caa5c256f2d447b | 16,319 | py | Python | pupa/importers/base.py | csnardi/pupa | b87ef9c6f45bb284acc29042e7ad498fffdde26d | [
"BSD-3-Clause"
] | null | null | null | pupa/importers/base.py | csnardi/pupa | b87ef9c6f45bb284acc29042e7ad498fffdde26d | [
"BSD-3-Clause"
] | null | null | null | pupa/importers/base.py | csnardi/pupa | b87ef9c6f45bb284acc29042e7ad498fffdde26d | [
"BSD-3-Clause"
] | null | null | null | import os
import copy
import glob
import json
import logging
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from opencivicdata.legislative.models import LegislativeSession
from pupa import settings
from pupa.exceptions import DuplicateItemError
from pupa.utils import get_pse... | 37.173121 | 99 | 0.556958 | import os
import copy
import glob
import json
import logging
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from opencivicdata.legislative.models import LegislativeSession
from pupa import settings
from pupa.exceptions import DuplicateItemError
from pupa.utils import get_pse... | true | true |
1c074bcd915451d65949aedbb25c0e7b9a53326c | 469 | py | Python | plotly/validators/scatterpolargl/marker/colorbar/_ypad.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/scatterpolargl/marker/colorbar/_ypad.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/scatterpolargl/marker/colorbar/_ypad.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class YpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='ypad',
parent_name='scatterpolargl.marker.colorbar',
**kwargs
):
super(YpadValidator, self).__init__(
plotly_name=plotly_... | 23.45 | 66 | 0.584222 | import _plotly_utils.basevalidators
class YpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name='ypad',
parent_name='scatterpolargl.marker.colorbar',
**kwargs
):
super(YpadValidator, self).__init__(
plotly_name=plotly_... | true | true |
1c074bded782602999fcd0f89cacd570644772f9 | 102 | py | Python | esercizi/listaWhile.py | gdv/python-alfabetizzazione | d87561222de8a230db11d8529c49cf1702aec326 | [
"MIT"
] | null | null | null | esercizi/listaWhile.py | gdv/python-alfabetizzazione | d87561222de8a230db11d8529c49cf1702aec326 | [
"MIT"
] | null | null | null | esercizi/listaWhile.py | gdv/python-alfabetizzazione | d87561222de8a230db11d8529c49cf1702aec326 | [
"MIT"
] | 1 | 2019-03-26T11:14:33.000Z | 2019-03-26T11:14:33.000Z | lista = [7, 3.0 + 5, 'pippo', 2 +1j]
i = 0
while (i < len(lista)):
print lista[i]
i = i + 1
| 12.75 | 36 | 0.460784 | lista = [7, 3.0 + 5, 'pippo', 2 +1j]
i = 0
while (i < len(lista)):
print lista[i]
i = i + 1
| false | true |
1c074d41a6cd6ab1b71afa619868e220e44b8969 | 438 | py | Python | tests/integration/cmor/_fixes/cmip5/test_mpi_esm_mr.py | markelg/ESMValCore | b2f7ffc3232f174dd5ebc50ad20b4a02d3517c2c | [
"Apache-2.0"
] | 26 | 2019-06-07T07:50:07.000Z | 2022-03-22T21:04:01.000Z | tests/integration/cmor/_fixes/cmip5/test_mpi_esm_mr.py | markelg/ESMValCore | b2f7ffc3232f174dd5ebc50ad20b4a02d3517c2c | [
"Apache-2.0"
] | 1,370 | 2019-06-06T09:03:07.000Z | 2022-03-31T04:37:20.000Z | tests/integration/cmor/_fixes/cmip5/test_mpi_esm_mr.py | zklaus/ESMValCore | 5656fb8b546eeb4d750a424de7ed56a237edfabb | [
"Apache-2.0"
] | 26 | 2019-07-03T13:08:48.000Z | 2022-03-02T16:08:47.000Z | """Test fixes for MPI-ESM-MR."""
from esmvalcore.cmor._fixes.cmip5.mpi_esm_mr import Cl
from esmvalcore.cmor._fixes.common import ClFixHybridPressureCoord
from esmvalcore.cmor._fixes.fix import Fix
def test_get_cl_fix():
"""Test getting of fix."""
fix = Fix.get_fixes('CMIP5', 'MPI-ESM-MR', 'Amon', 'cl')
a... | 27.375 | 66 | 0.69863 | from esmvalcore.cmor._fixes.cmip5.mpi_esm_mr import Cl
from esmvalcore.cmor._fixes.common import ClFixHybridPressureCoord
from esmvalcore.cmor._fixes.fix import Fix
def test_get_cl_fix():
fix = Fix.get_fixes('CMIP5', 'MPI-ESM-MR', 'Amon', 'cl')
assert fix == [Cl(None)]
def test_cl_fix():
assert Cl is Cl... | true | true |
1c074dbdf363664fe46d2ea1ddad816e6e7b9ee6 | 1,774 | py | Python | scripts/async/sand.py | edemaine/taichi_mpm | 3bb90fbe4c901aafc048dbb2d8d8aa388226d011 | [
"MIT"
] | 2,137 | 2018-08-11T08:15:55.000Z | 2022-03-31T12:35:56.000Z | scripts/async/sand.py | LucasCampos/taichi_mpm | cd866e0546fb0c6383144ee0dac7d6e3884e00d3 | [
"MIT"
] | 52 | 2018-08-18T02:29:07.000Z | 2022-02-23T03:03:24.000Z | scripts/async/sand.py | LucasCampos/taichi_mpm | cd866e0546fb0c6383144ee0dac7d6e3884e00d3 | [
"MIT"
] | 321 | 2018-08-16T05:43:45.000Z | 2022-03-25T09:34:53.000Z | import taichi as tc
from math import *
from random import *
from async_mpm import AsyncMPM
r = 400
task_id = 'sand'
Async = True
if __name__ == '__main__':
res = (r, r, r)
if Async:
mpm = AsyncMPM(
res=res,
particle_collision=False,
optimized=True,
verbose_bgeo=True,
g... | 23.972973 | 79 | 0.550733 | import taichi as tc
from math import *
from random import *
from async_mpm import AsyncMPM
r = 400
task_id = 'sand'
Async = True
if __name__ == '__main__':
res = (r, r, r)
if Async:
mpm = AsyncMPM(
res=res,
particle_collision=False,
optimized=True,
verbose_bgeo=True,
g... | true | true |
1c074e9c734faa79683c148c924150defdc4ba1e | 8,360 | py | Python | installers/linux/install.py | ChromaticIsobar/HyperTremolo | e84b49abe926fd2bd8db6a95ab0dd53544baf639 | [
"MIT"
] | null | null | null | installers/linux/install.py | ChromaticIsobar/HyperTremolo | e84b49abe926fd2bd8db6a95ab0dd53544baf639 | [
"MIT"
] | 4 | 2021-11-11T11:06:43.000Z | 2021-11-14T16:25:57.000Z | installers/linux/install.py | ChromaticIsobar/HyperTremolo | e84b49abe926fd2bd8db6a95ab0dd53544baf639 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Download and install HyperTremolo"""
import functools
import tempfile
import argparse
import requests
import logging
import zipfile
import shutil
import json
import stat
import sys
import os
from typing import Sequence
logger = logging.getLogger("HyperTremolo Installer")
class ReturnExcepti... | 30.510949 | 80 | 0.595335 | import functools
import tempfile
import argparse
import requests
import logging
import zipfile
import shutil
import json
import stat
import sys
import os
from typing import Sequence
logger = logging.getLogger("HyperTremolo Installer")
class ReturnException(Exception):
value: int = 0
class ReturnFailException(Ret... | true | true |
1c075021016ee7311e487f4159827619626a36dc | 1,893 | py | Python | desafio_iafront/jobs/escala_pedidos/job_normalizacao.py | LuizJunior98/desafio-iafront | 6769fcbbe85d4a8b2570c08af65dfd87e8135526 | [
"MIT"
] | null | null | null | desafio_iafront/jobs/escala_pedidos/job_normalizacao.py | LuizJunior98/desafio-iafront | 6769fcbbe85d4a8b2570c08af65dfd87e8135526 | [
"MIT"
] | null | null | null | desafio_iafront/jobs/escala_pedidos/job_normalizacao.py | LuizJunior98/desafio-iafront | 6769fcbbe85d4a8b2570c08af65dfd87e8135526 | [
"MIT"
] | 1 | 2020-08-10T21:55:54.000Z | 2020-08-10T21:55:54.000Z | import click
from desafio_iafront.jobs.escala_pedidos.preprocessing import Preprocessing
from desafio_iafront.jobs.common import prepare_dataframe
@click.command()
@click.option('--visitas-com-conversao', type=click.Path(exists=True))
@click.option('--saida', type=click.Path(exists=False, dir_okay=True, file_okay=F... | 41.152174 | 106 | 0.731643 | import click
from desafio_iafront.jobs.escala_pedidos.preprocessing import Preprocessing
from desafio_iafront.jobs.common import prepare_dataframe
@click.command()
@click.option('--visitas-com-conversao', type=click.Path(exists=True))
@click.option('--saida', type=click.Path(exists=False, dir_okay=True, file_okay=F... | true | true |
1c07506ecd78a9a56a2bcdaae0b36faef8ea6b65 | 377 | py | Python | .history/ClassFiles/DataTypes/Number_20201230222126.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DataTypes/Number_20201230222126.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/DataTypes/Number_20201230222126.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | """ Number Data types
Integers(int)
Integer is a whole number, positive or negative, without decimals, of unlimited length.
Examples: 0 100 -80 400 # Must not have decimals.
Floating Point(float)
Floating point number is a number, positive or negative, containing one or more decimals.
Examples: 0.0 4... | 31.416667 | 89 | 0.692308 | true | true | |
1c07510f1a969c082a142692afabff8fd176f3ff | 243 | py | Python | 1/if.py | Gregorita12/training2019 | 50e8637b43c5d33ed41ebe8f5650dd49ff8c4171 | [
"MIT"
] | 4 | 2019-11-05T18:12:48.000Z | 2019-12-17T14:14:24.000Z | 1/if.py | Gregorita12/training2019 | 50e8637b43c5d33ed41ebe8f5650dd49ff8c4171 | [
"MIT"
] | 1 | 2019-12-15T13:15:17.000Z | 2019-12-15T13:15:17.000Z | 1/if.py | Gregorita12/training2019 | 50e8637b43c5d33ed41ebe8f5650dd49ff8c4171 | [
"MIT"
] | 3 | 2019-12-15T12:10:17.000Z | 2019-12-17T14:24:22.000Z | x = int(input("Elo typie, daj mi 5\n"))
y = int(input("Elo typie, daj mi 2\n"))
if x == 5 and y == 2:
print("Brawo! Podałeś poprawny kod!")
elif x == 5 or y == 2:
print("Prawie dobrze.. :)")
else:
print("No niestety. Błędny kod.")
| 27 | 41 | 0.576132 | x = int(input("Elo typie, daj mi 5\n"))
y = int(input("Elo typie, daj mi 2\n"))
if x == 5 and y == 2:
print("Brawo! Podałeś poprawny kod!")
elif x == 5 or y == 2:
print("Prawie dobrze.. :)")
else:
print("No niestety. Błędny kod.")
| true | true |
1c07511888d6f641fd2d59a9e9161174e1ef1b5c | 3,800 | py | Python | tensorflow/tools/test/check_futures_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/tools/test/check_futures_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 48 | 2016-07-26T00:11:55.000Z | 2022-02-23T13:36:33.000Z | tensorflow/tools/test/check_futures_test.py | ryorda/tensorflow-viennacl | 054b515feec0a3fca4cfb1f29adbf423c9027c3a | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2015 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... | 35.185185 | 80 | 0.675 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import fnmatch
import os
import re
import six
BASE_DIR = os.path.normpath(os.path.join(__file__, '../../..'))
FUTURES_PATTERN = re.compile(r'^from __future__ import (\w+)\s*$')
FUTURES_PATTERN_2 = re.compile... | true | true |
1c075238a26893a2247e899072d1e4aa1798662b | 2,094 | py | Python | settings/__init__.py | chidioguejiofor/flask_boilerplate | 62e9b016e9d471906a71c376f1a4836e05b2f1ed | [
"MIT"
] | null | null | null | settings/__init__.py | chidioguejiofor/flask_boilerplate | 62e9b016e9d471906a71c376f1a4836e05b2f1ed | [
"MIT"
] | null | null | null | settings/__init__.py | chidioguejiofor/flask_boilerplate | 62e9b016e9d471906a71c376f1a4836e05b2f1ed | [
"MIT"
] | null | null | null | """API Initialization Module"""
import inspect
from flask import Flask, jsonify, Blueprint
from flask_restplus import Api
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
import dotenv
from api.utils.eror_handler import error_handlers
from .configs import ENV_MAPP... | 23.266667 | 69 | 0.65616 |
import inspect
from flask import Flask, jsonify, Blueprint
from flask_restplus import Api
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_cors import CORS
import dotenv
from api.utils.eror_handler import error_handlers
from .configs import ENV_MAPPER
db = SQLAlchemy()
dotenv.loa... | true | true |
1c0752514a38e03d6d1dedb542b7b7e5b162797e | 232 | py | Python | tests/test_imports.py | cnheider/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 1 | 2018-11-30T09:14:28.000Z | 2018-11-30T09:14:28.000Z | tests/test_imports.py | aivclab/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 49 | 2019-04-02T12:06:10.000Z | 2019-08-31T14:30:12.000Z | tests/test_imports.py | cnHeider/warg | 4bcc5d3e86dd843773ca6cbca21bcab3b8ae84eb | [
"Apache-2.0"
] | 1 | 2019-03-16T13:56:03.000Z | 2019-03-16T13:56:03.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 01/08/2020
"""
__all__ = []
def test_import():
import warg
print(warg.__version__)
| 13.647059 | 39 | 0.577586 |
__author__ = "Christian Heider Nielsen"
__doc__ = r"""
Created on 01/08/2020
"""
__all__ = []
def test_import():
import warg
print(warg.__version__)
| true | true |
1c07525c4568541417f6d6f89c4fa939512dd854 | 34,768 | py | Python | python/ray/rllib/evaluation/rollout_worker.py | tonymackinnon/ray | 14a1419682bdba40d2c8bf226e1727cf44abcaa4 | [
"Apache-2.0"
] | null | null | null | python/ray/rllib/evaluation/rollout_worker.py | tonymackinnon/ray | 14a1419682bdba40d2c8bf226e1727cf44abcaa4 | [
"Apache-2.0"
] | null | null | null | python/ray/rllib/evaluation/rollout_worker.py | tonymackinnon/ray | 14a1419682bdba40d2c8bf226e1727cf44abcaa4 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import numpy as np
import gym
import logging
import pickle
import ray
from ray.rllib.env.atari_wrappers import wrap_deepmind, is_atari
from ray.rllib.env.base_env import BaseEnv
from ray.rllib.en... | 42.4 | 79 | 0.592154 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import numpy as np
import gym
import logging
import pickle
import ray
from ray.rllib.env.atari_wrappers import wrap_deepmind, is_atari
from ray.rllib.env.base_env import BaseEnv
from ray.rllib.en... | true | true |
1c0752940a6eb89e855a6689e11b25ca3d611ba8 | 81 | py | Python | Iniciante/uri1004/uri1004.py | GCCDV/URI | 73a25c3dc12bda7e12335988e73181fe196fecfe | [
"MIT"
] | null | null | null | Iniciante/uri1004/uri1004.py | GCCDV/URI | 73a25c3dc12bda7e12335988e73181fe196fecfe | [
"MIT"
] | null | null | null | Iniciante/uri1004/uri1004.py | GCCDV/URI | 73a25c3dc12bda7e12335988e73181fe196fecfe | [
"MIT"
] | 1 | 2022-03-29T04:16:02.000Z | 2022-03-29T04:16:02.000Z | A = int(input())
B = int(input())
PROD = A * B
print("PROD = {}".format(PROD))
| 11.571429 | 31 | 0.530864 | A = int(input())
B = int(input())
PROD = A * B
print("PROD = {}".format(PROD))
| true | true |
1c07531d91e8c33e79c7bfb62b5613820854b6fd | 1,407 | py | Python | biobb_analysis/test/unitests/test_ambertools/test_cpptraj_rms.py | bioexcel/biobb_analysis | 794683daf65eb13ddaaaf6cf3c19da6d1322a949 | [
"Apache-2.0"
] | 3 | 2019-05-18T14:52:30.000Z | 2020-10-18T06:20:00.000Z | biobb_analysis/test/unitests/test_ambertools/test_cpptraj_rms.py | bioexcel/biobb_analysis | 794683daf65eb13ddaaaf6cf3c19da6d1322a949 | [
"Apache-2.0"
] | 7 | 2019-03-04T15:04:28.000Z | 2021-06-17T10:57:25.000Z | biobb_analysis/test/unitests/test_ambertools/test_cpptraj_rms.py | bioexcel/biobb_analysis | 794683daf65eb13ddaaaf6cf3c19da6d1322a949 | [
"Apache-2.0"
] | null | null | null | from biobb_common.tools import test_fixtures as fx
from biobb_analysis.ambertools.cpptraj_rms import cpptraj_rms
class TestCpptrajRmsFirst():
def setUp(self):
fx.test_setup(self,'cpptraj_rms_first')
def tearDown(self):
fx.test_teardown(self)
pass
def test_rms_first(self):
... | 32.72093 | 97 | 0.7086 | from biobb_common.tools import test_fixtures as fx
from biobb_analysis.ambertools.cpptraj_rms import cpptraj_rms
class TestCpptrajRmsFirst():
def setUp(self):
fx.test_setup(self,'cpptraj_rms_first')
def tearDown(self):
fx.test_teardown(self)
pass
def test_rms_first(self):
... | true | true |
1c075345f1ea0888b754db82a126d1bcc2bc7aa6 | 1,464 | py | Python | 13-urllib/urllib_request_download_file.py | saidulislam/Python-Experiment | 0f63e0e6682b7a4d09f01a60adc926de2111e930 | [
"Apache-2.0"
] | null | null | null | 13-urllib/urllib_request_download_file.py | saidulislam/Python-Experiment | 0f63e0e6682b7a4d09f01a60adc926de2111e930 | [
"Apache-2.0"
] | null | null | null | 13-urllib/urllib_request_download_file.py | saidulislam/Python-Experiment | 0f63e0e6682b7a4d09f01a60adc926de2111e930 | [
"Apache-2.0"
] | null | null | null | # import urllib.request
# url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip'
# response = urllib.request.urlopen(url)
# data = response.read()
# with open('test.zip', 'wb') as fobj:
# fobj.write(data)
# another way to download
# both are valid
# import urllib.request
... | 40.666667 | 93 | 0.705601 |
import urllib.request
user_agent = ' Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0'
url = 'http://www.whatsmyua.com/'
headers = {'User-Agent': user_agent}
request = urllib.request.Request(url, headers=headers)
with urllib.request.urlopen(request) as response:
with ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.