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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f77a1354f30582656b15f82acbd45df9cb329545 | 2,814 | py | Python | icp_ws/src/course_agv_slam/scripts/mapping.py | MJYINMC/Wheeled-Robot | 7425c9bdf4a2e55b7b4a4420a012a3daa3a6a114 | [
"Apache-2.0"
] | null | null | null | icp_ws/src/course_agv_slam/scripts/mapping.py | MJYINMC/Wheeled-Robot | 7425c9bdf4a2e55b7b4a4420a012a3daa3a6a114 | [
"Apache-2.0"
] | null | null | null | icp_ws/src/course_agv_slam/scripts/mapping.py | MJYINMC/Wheeled-Robot | 7425c9bdf4a2e55b7b4a4420a012a3daa3a6a114 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import math
import numpy as np
# f = open('/home/rosuser/catkin_ws/tmp/mapping.log', 'w')
def fprint(s):
return
f.write(s)
f.write('\n')
f.flush()
class Mapping():
def __init__(self, xw, yw, xyreso):
self.width_x = xw*xyreso
self.width_y = yw*xyreso
se... | 28.714286 | 93 | 0.471926 | import math
import numpy as np
def fprint(s):
return
f.write(s)
f.write('\n')
f.flush()
class Mapping():
def __init__(self, xw, yw, xyreso):
self.width_x = xw*xyreso
self.width_y = yw*xyreso
self.xyreso = xyreso
self.xw = xw
self.yw = yw
self... | true | true |
f77a1376f1cb08f237f2bd3d270191e588f0ecc8 | 4,852 | py | Python | python/http_client/v1/polyaxon_sdk/models/v1_hp_log_normal.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | python/http_client/v1/polyaxon_sdk/models/v1_hp_log_normal.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | python/http_client/v1/polyaxon_sdk/models/v1_hp_log_normal.py | polyaxon/client | 1beaf78b0aa9fabc37b42a253d5e29c0623d8b16 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | 27.725714 | 98 | 0.588623 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re import six
from polyaxon_sdk.configuration import Configuration
class V1HpLogNormal(object):
openapi_types = {
'kind': 'str',
'value': 'object'
}
... | true | true |
f77a13bcd2ed5153f048cdb705177183f9bb9009 | 22,828 | py | Python | python/tvm/autotvm/measure/measure_methods.py | grwlf/tvm | 4ac64fc4462dd670475051cd0f32dcec7330a3d3 | [
"Apache-2.0"
] | 1 | 2021-03-07T15:30:16.000Z | 2021-03-07T15:30:16.000Z | python/tvm/autotvm/measure/measure_methods.py | grwlf/tvm | 4ac64fc4462dd670475051cd0f32dcec7330a3d3 | [
"Apache-2.0"
] | null | null | null | python/tvm/autotvm/measure/measure_methods.py | grwlf/tvm | 4ac64fc4462dd670475051cd0f32dcec7330a3d3 | [
"Apache-2.0"
] | 1 | 2020-02-09T10:42:31.000Z | 2020-02-09T10:42:31.000Z | # pylint: disable=invalid-name,too-many-function-args,too-many-nested-blocks
"""
Functions that run on executor for measurement.
These functions are responsible for building the tvm module, uploading it to
remote devices, recording the running time costs, and checking the correctness of the output.
"""
import logging... | 39.223368 | 98 | 0.602199 |
import logging
import shutil
import os
import threading
import time
from random import getrandbits
from collections import namedtuple
import tempfile
import numpy as np
from ... import ir_pass, build, build_config, nd, TVMError, register_func, \
rpc as _rpc, target as _target
from ...contrib import nvcc, ndk
fr... | true | true |
f77a14b9e7ee2aacd2da029ef10adb0159237fbc | 3,129 | py | Python | resumeparser/resumeparser/settings.py | RidaNoor/resume-parser | 4247f16bdf51b2dbc9c8919a9c05e85d67d7e8bf | [
"MIT"
] | 14 | 2019-11-14T08:26:55.000Z | 2022-01-31T21:29:52.000Z | resumeparser/resumeparser/settings.py | RidaNoor/resume-parser | 4247f16bdf51b2dbc9c8919a9c05e85d67d7e8bf | [
"MIT"
] | 6 | 2019-12-20T00:51:18.000Z | 2022-02-10T13:28:56.000Z | resumeparser/resumeparser/settings.py | RidaNoor/resume-parser | 4247f16bdf51b2dbc9c8919a9c05e85d67d7e8bf | [
"MIT"
] | 8 | 2019-11-16T14:13:26.000Z | 2022-01-30T07:18:36.000Z | """
Django settings for resumeparser project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import ... | 25.647541 | 91 | 0.697667 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'j%t%gkcko$^x)!z6e_4)1x*55fwkbie)a!wwowupkejnohrv_z'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
f77a15285c01837a993cad5b3c0a40240949d96f | 76,981 | py | Python | keystone-moon/keystone/tests/unit/test_v3_protection.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/tests/unit/test_v3_protection.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/tests/unit/test_v3_protection.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 43.2964 | 79 | 0.630987 |
import uuid
from oslo_config import cfg
from oslo_serialization import jsonutils
from six.moves import http_client
from keystone import exception
from keystone.tests import unit
from keystone.tests.unit import ksfixtures
from keystone.tests.unit.ksfixtures import temporaryfile
from keystone.tests.unit import test_v3... | true | true |
f77a17f703afbb61fecda36324125051b6a705fb | 5,556 | py | Python | python/example/rolling_jelly_3d.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | 4 | 2022-02-10T02:28:42.000Z | 2022-02-10T07:28:35.000Z | python/example/rolling_jelly_3d.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | null | null | null | python/example/rolling_jelly_3d.py | srl-ethz/diffPD_sim2real | e491668995a163b8ff7542d99f0b4e0c0f4ed2df | [
"MIT"
] | null | null | null | import sys
sys.path.append('../')
import os
from pathlib import Path
import time
import numpy as np
import scipy.optimize
import pickle
from py_diff_pd.common.common import ndarray, create_folder, rpy_to_rotation, rpy_to_rotation_gradient
from py_diff_pd.common.common import print_info, print_ok, print_error, PrettyT... | 43.748031 | 123 | 0.596112 | import sys
sys.path.append('../')
import os
from pathlib import Path
import time
import numpy as np
import scipy.optimize
import pickle
from py_diff_pd.common.common import ndarray, create_folder, rpy_to_rotation, rpy_to_rotation_gradient
from py_diff_pd.common.common import print_info, print_ok, print_error, PrettyT... | true | true |
f77a184c94e1c0aecadd51c63ab384d6b27e706d | 17,472 | py | Python | tensorflow/net/network.py | Palspal98/inpainting_gmcnn | e9af21043fc665df55ab36bf65463618f88c1b69 | [
"MIT"
] | 357 | 2018-11-02T11:09:34.000Z | 2022-03-31T07:58:25.000Z | tensorflow/net/network.py | Palspal98/inpainting_gmcnn | e9af21043fc665df55ab36bf65463618f88c1b69 | [
"MIT"
] | 74 | 2019-01-15T05:55:33.000Z | 2022-03-01T06:48:24.000Z | tensorflow/net/network.py | Palspal98/inpainting_gmcnn | e9af21043fc665df55ab36bf65463618f88c1b69 | [
"MIT"
] | 93 | 2019-03-14T10:02:04.000Z | 2022-03-23T08:48:20.000Z | import tensorflow as tf
from net.ops import random_bbox, bbox2mask, local_patch
from net.ops import priority_loss_mask
from net.ops import id_mrf_reg
from net.ops import gan_wgan_loss, gradients_penalty, random_interpolates
from net.ops import free_form_mask_tf
from util.util import f2uint
from functools import partial... | 57.854305 | 123 | 0.626603 | import tensorflow as tf
from net.ops import random_bbox, bbox2mask, local_patch
from net.ops import priority_loss_mask
from net.ops import id_mrf_reg
from net.ops import gan_wgan_loss, gradients_penalty, random_interpolates
from net.ops import free_form_mask_tf
from util.util import f2uint
from functools import partial... | true | true |
f77a1855f8944dc41c3da06e98cf86395dce9686 | 2,590 | py | Python | vmware_nsx/db/migration/alembic_migrations/versions/newton/contract/5ed1ffbc0d2a_nsx_security_group_logging.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/db/migration/alembic_migrations/versions/newton/contract/5ed1ffbc0d2a_nsx_security_group_logging.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/db/migration/alembic_migrations/versions/newton/contract/5ed1ffbc0d2a_nsx_security_group_logging.py | yebinama/vmware-nsx | 5f59ce8d4668c24e0f4f934898fb4b4e63f1c2f4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 OpenStack Foundation
#
# 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 ... | 35.479452 | 79 | 0.641313 |
from alembic import op
import sqlalchemy as sa
revision = '5ed1ffbc0d2a'
down_revision = '3c88bdea3054'
depends_on = ('3e4dccfe6fb4',)
def upgrade():
secgroup_prop_table = sa.Table(
'nsx_extended_security_group_properties',
sa.MetaData(),
sa.Column('security_group_id', sa.String(36), nu... | true | true |
f77a18f6e0785f1a7c3f43e616e9e15871a1b585 | 2,151 | py | Python | gsf/service.py | geospatial-services-framework/gsfpy | 282a9da3399504229f16cf2449819c3758b33bbc | [
"MIT"
] | 1 | 2021-08-17T06:33:59.000Z | 2021-08-17T06:33:59.000Z | gsf/service.py | geospatial-services-framework/gsfpy | 282a9da3399504229f16cf2449819c3758b33bbc | [
"MIT"
] | null | null | null | gsf/service.py | geospatial-services-framework/gsfpy | 282a9da3399504229f16cf2449819c3758b33bbc | [
"MIT"
] | null | null | null | """
The GSF service object connects to a GSF Service and its tasks.
"""
from __future__ import absolute_import
from abc import abstractmethod, abstractproperty
from string import Template
from .gsfmeta import GSFMeta
from .utils import with_metaclass
class Service(with_metaclass(GSFMeta, object)):
"""
The GSF... | 22.882979 | 64 | 0.606695 | from __future__ import absolute_import
from abc import abstractmethod, abstractproperty
from string import Template
from .gsfmeta import GSFMeta
from .utils import with_metaclass
class Service(with_metaclass(GSFMeta, object)):
def __str__(self):
props = dict(name=self.name,
descripti... | true | true |
f77a192fa2c249c14e24828dfd7884355ec919ef | 2,983 | py | Python | scanpy_normalization.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | null | null | null | scanpy_normalization.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | 1 | 2020-06-16T17:14:45.000Z | 2020-06-16T17:14:45.000Z | scanpy_normalization.py | granatumx/gbox-py | b3e264a22bc6a041f2dd631d952eae29c0ecae21 | [
"MIT"
] | 2 | 2020-06-16T16:42:40.000Z | 2020-08-28T16:59:42.000Z | from itertools import combinations
import multiprocessing
import scanpy.api as sc
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import quantile_transform
from scipy.sparse import csc_matrix
from granatum_sdk import Granatum
# import pandas as pd
# import seaborn as sns
nans = np.arr... | 28.409524 | 136 | 0.676165 | from itertools import combinations
import multiprocessing
import scanpy.api as sc
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import quantile_transform
from scipy.sparse import csc_matrix
from granatum_sdk import Granatum
nans = np.array([np.nan, np.nan])
zeros = np.array([0, 0])
... | true | true |
f77a194fc78c766abc6fd5c2fa041d0a969cb465 | 11,389 | py | Python | gdal/swig/python/samples/gdal_vrtmerge.py | robe2/gdal | 78573efe69f1506c112209501068c0b043438295 | [
"MIT"
] | null | null | null | gdal/swig/python/samples/gdal_vrtmerge.py | robe2/gdal | 78573efe69f1506c112209501068c0b043438295 | [
"MIT"
] | null | null | null | gdal/swig/python/samples/gdal_vrtmerge.py | robe2/gdal | 78573efe69f1506c112209501068c0b043438295 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2000, Atlantis Scientific Inc. (www.atlsci.com)
# Copyright (C) 2005 Gabriel Ebner <ge@gabrielebner.at>
# Copyright (c) 2009, Even Rouault <even dot rouault at mines-paris dot org>
#
# This library is free software; you can redistribute it and/or
# modify i... | 35.151235 | 102 | 0.550092 |
import sys
from osgeo import gdal
def names_to_fileinfos( names ):
file_infos = []
for name in names:
fi = file_info()
if fi.init_from_name(name):
file_infos.append(fi)
else:
print ('Can not open dataset "%s", skipped' % name)
return file_infos
class fil... | true | true |
f77a1973e97e586c85a67de5cae25afb606bd785 | 138 | py | Python | python_mock/compare_dict.py | enamrik/python-mock | 817bf1ada9346445912e2cd2e2f65306e21cb8d8 | [
"MIT"
] | null | null | null | python_mock/compare_dict.py | enamrik/python-mock | 817bf1ada9346445912e2cd2e2f65306e21cb8d8 | [
"MIT"
] | null | null | null | python_mock/compare_dict.py | enamrik/python-mock | 817bf1ada9346445912e2cd2e2f65306e21cb8d8 | [
"MIT"
] | null | null | null | from dictdiffer import diff
def is_same_dict(dict1, dict2):
result = list(diff(dict1, dict2))
return len(result) == 0, result
| 15.333333 | 37 | 0.688406 | from dictdiffer import diff
def is_same_dict(dict1, dict2):
result = list(diff(dict1, dict2))
return len(result) == 0, result
| true | true |
f77a1a11ca1919c5a7b6685a0a8500eddb33574c | 16,935 | py | Python | tests/components/mqtt/test_state_vacuum.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 1 | 2022-03-23T19:48:30.000Z | 2022-03-23T19:48:30.000Z | tests/components/mqtt/test_state_vacuum.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:46:31.000Z | 2022-03-12T00:35:09.000Z | tests/components/mqtt/test_state_vacuum.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 1 | 2020-06-09T20:54:05.000Z | 2020-06-09T20:54:05.000Z | """The tests for the State vacuum Mqtt platform."""
from copy import deepcopy
import json
import pytest
from homeassistant.components import vacuum
from homeassistant.components.mqtt import CONF_COMMAND_TOPIC, CONF_STATE_TOPIC
from homeassistant.components.mqtt.vacuum import CONF_SCHEMA, schema_state as mqttvacuum
fr... | 35.652632 | 88 | 0.723059 | from copy import deepcopy
import json
import pytest
from homeassistant.components import vacuum
from homeassistant.components.mqtt import CONF_COMMAND_TOPIC, CONF_STATE_TOPIC
from homeassistant.components.mqtt.vacuum import CONF_SCHEMA, schema_state as mqttvacuum
from homeassistant.components.mqtt.vacuum.schema impor... | true | true |
f77a1b1ea87dfa9bab5e5ac3951a706616b9aac5 | 15,972 | py | Python | dashboard/apps/hub/migrations/0016_auto__del_unique_elecdata_end_date_office_state_race_type_organization.py | GPHemsley/dashboard | 892d68566ac6fafe88b7546d8509619eb8fd6676 | [
"MIT"
] | 1 | 2020-02-14T08:52:55.000Z | 2020-02-14T08:52:55.000Z | dashboard/apps/hub/migrations/0016_auto__del_unique_elecdata_end_date_office_state_race_type_organization.py | GPHemsley/dashboard | 892d68566ac6fafe88b7546d8509619eb8fd6676 | [
"MIT"
] | null | null | null | dashboard/apps/hub/migrations/0016_auto__del_unique_elecdata_end_date_office_state_race_type_organization.py | GPHemsley/dashboard | 892d68566ac6fafe88b7546d8509619eb8fd6676 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'ElecData', fields ['end_date', 'office', 'state', 'race_type', 'organization', 'dis... | 81.907692 | 212 | 0.558352 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.delete_unique('hub_elecdata', ['end_date', 'office_id', 'state_id', 'race_type', 'organization_id', 'district', 'special'])
... | true | true |
f77a1cb3cacca7969d0870ed198fab84a5e50bb6 | 1,219 | py | Python | Seeder/harvests/scheduler.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 8 | 2017-08-16T19:18:57.000Z | 2022-01-24T10:08:19.000Z | Seeder/harvests/scheduler.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 242 | 2017-02-03T19:15:52.000Z | 2022-03-25T08:02:52.000Z | Seeder/harvests/scheduler.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 2 | 2019-03-06T12:36:29.000Z | 2019-07-08T12:52:20.000Z | from datetime import date, timedelta
INITIAL_OFFSET = timedelta(days=5)
class IntervalException(Exception):
"""
Exception to be raises when interval is behaving
weirdly - as not an interval
"""
def get_dates_for_timedelta(interval_delta, start=None, stop=None,
skip_weeke... | 27.088889 | 71 | 0.658737 | from datetime import date, timedelta
INITIAL_OFFSET = timedelta(days=5)
class IntervalException(Exception):
def get_dates_for_timedelta(interval_delta, start=None, stop=None,
skip_weekend=False):
if start is None:
start = date.today()
if stop is None:
stop = sta... | true | true |
f77a1d47e864c6a5f71c6bc91c1805effe12f406 | 1,583 | py | Python | coopy/snapshot.py | felipecruz/coopy | 507221f2dead6145e884dea99999d603ee175178 | [
"BSD-3-Clause"
] | 15 | 2015-06-09T20:07:45.000Z | 2022-02-13T20:40:57.000Z | coopy/snapshot.py | felipecruz/coopy | 507221f2dead6145e884dea99999d603ee175178 | [
"BSD-3-Clause"
] | null | null | null | coopy/snapshot.py | felipecruz/coopy | 507221f2dead6145e884dea99999d603ee175178 | [
"BSD-3-Clause"
] | 1 | 2019-11-27T12:30:33.000Z | 2019-11-27T12:30:33.000Z | import six
import threading
import logging
import pickle
from coopy import fileutils as fu
from os import path
if six.PY3:
from pickle import Pickler, Unpickler
else:
from cPickle import Pickler, Unpickler
logger = logging.getLogger("coopy")
class SnapshotManager(object):
def __init__(self, basedir):
... | 26.830508 | 85 | 0.620973 | import six
import threading
import logging
import pickle
from coopy import fileutils as fu
from os import path
if six.PY3:
from pickle import Pickler, Unpickler
else:
from cPickle import Pickler, Unpickler
logger = logging.getLogger("coopy")
class SnapshotManager(object):
def __init__(self, basedir):
... | true | true |
f77a1e5e1979a1181c79b1bc1004b9e4ed2a4853 | 6,997 | py | Python | cuegui/cuegui/CueStateBarWidget.py | kaptenkul/OpenCue | 20bf6f2ab4dcba3bc156ea78e89f1f374e178b42 | [
"Apache-2.0"
] | null | null | null | cuegui/cuegui/CueStateBarWidget.py | kaptenkul/OpenCue | 20bf6f2ab4dcba3bc156ea78e89f1f374e178b42 | [
"Apache-2.0"
] | 1 | 2020-09-09T20:39:24.000Z | 2020-09-09T20:39:24.000Z | cuegui/cuegui/CueStateBarWidget.py | kaptenkul/OpenCue | 20bf6f2ab4dcba3bc156ea78e89f1f374e178b42 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the OpenCue Project
#
# 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... | 36.06701 | 88 | 0.597828 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
import time
import weakref
from PySide2 import QtCore
from PySide2 import QtGui
from PySide2 import QtWidgets
import cuegui.Logger
logger = cuegui.Logger.getLogger(__file__)
class CueSt... | true | true |
f77a1ef84dcc24a408a200ebe4600cc523730051 | 694 | py | Python | src/bpp/management/commands/usun_nieuzywane_charaktery_kbny.py | iplweb/django-bpp | 85f183a99d8d5027ae4772efac1e4a9f21675849 | [
"BSD-3-Clause"
] | 1 | 2017-04-27T19:50:02.000Z | 2017-04-27T19:50:02.000Z | src/bpp/management/commands/usun_nieuzywane_charaktery_kbny.py | mpasternak/django-bpp | 434338821d5ad1aaee598f6327151aba0af66f5e | [
"BSD-3-Clause"
] | 41 | 2019-11-07T00:07:02.000Z | 2022-02-27T22:09:39.000Z | src/bpp/management/commands/usun_nieuzywane_charaktery_kbny.py | iplweb/bpp | f027415cc3faf1ca79082bf7bacd4be35b1a6fdf | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
from django.core.management import BaseCommand
from django.db.models import CharField, TextField, Q
from django.apps import apps
from bpp.models import Sumy, Typ_KBN, Charakter_Formalny
from bpp.util import usun_nieuzywany_typ_charakter
class Command(BaseCommand):
help = "Usuwa nieuzywa... | 36.526316 | 88 | 0.757925 |
from django.core.management import BaseCommand
from django.db.models import CharField, TextField, Q
from django.apps import apps
from bpp.models import Sumy, Typ_KBN, Charakter_Formalny
from bpp.util import usun_nieuzywany_typ_charakter
class Command(BaseCommand):
help = "Usuwa nieuzywane charaktery formalne i t... | true | true |
f77a202e3ded2d887f3cc51561429da5fbea1c36 | 3,020 | py | Python | Sprints/Sprint 03/test_Compras.py | gabriel-venezian/napp-academy | 326ada0316df31fcfe9ebb7f36e752d43a009493 | [
"MIT"
] | null | null | null | Sprints/Sprint 03/test_Compras.py | gabriel-venezian/napp-academy | 326ada0316df31fcfe9ebb7f36e752d43a009493 | [
"MIT"
] | null | null | null | Sprints/Sprint 03/test_Compras.py | gabriel-venezian/napp-academy | 326ada0316df31fcfe9ebb7f36e752d43a009493 | [
"MIT"
] | null | null | null | from Registro import Registro
from Compras import Compras
from sqlite3 import OperationalError
import os
import pytest
class TestCompras:
def test_class_declared(self):
objeto = Compras('vendas.db')
assert isinstance(objeto, Compras)
def test_instanciar(self):
objeto = Compras('vendas... | 35.952381 | 78 | 0.66755 | from Registro import Registro
from Compras import Compras
from sqlite3 import OperationalError
import os
import pytest
class TestCompras:
def test_class_declared(self):
objeto = Compras('vendas.db')
assert isinstance(objeto, Compras)
def test_instanciar(self):
objeto = Compras('vendas... | true | true |
f77a21a447fe6b3c35623b572c478f1eadb74a6e | 5,006 | py | Python | pyanoled/ui/ControlApp.py | ethanlu/pyanoled | 5eabefc791c70afecfd2f4e3b61c78d150c6f551 | [
"MIT"
] | null | null | null | pyanoled/ui/ControlApp.py | ethanlu/pyanoled | 5eabefc791c70afecfd2f4e3b61c78d150c6f551 | [
"MIT"
] | null | null | null | pyanoled/ui/ControlApp.py | ethanlu/pyanoled | 5eabefc791c70afecfd2f4e3b61c78d150c6f551 | [
"MIT"
] | null | null | null | from pyanoled.Configuration import Configuration
from pyanoled.State import State
from pyanoled.ui.displays.Display import Display
from pyanoled.ui.menus.MainMenu import MainMenu
from logging import Logger
from PIL import Image, ImageDraw
from typing import Type
import importlib
import RPi.GPIO as GPIO
import time
... | 38.21374 | 92 | 0.564722 | from pyanoled.Configuration import Configuration
from pyanoled.State import State
from pyanoled.ui.displays.Display import Display
from pyanoled.ui.menus.MainMenu import MainMenu
from logging import Logger
from PIL import Image, ImageDraw
from typing import Type
import importlib
import RPi.GPIO as GPIO
import time
... | true | true |
f77a221def4ba262913437532b05d2da3ec66e65 | 2,608 | py | Python | ReconocimientoFacial.py | Flashstacks/facial-recognition | 93998bc17819ff8862603cd2660f2abc5c356d24 | [
"MIT"
] | null | null | null | ReconocimientoFacial.py | Flashstacks/facial-recognition | 93998bc17819ff8862603cd2660f2abc5c356d24 | [
"MIT"
] | null | null | null | ReconocimientoFacial.py | Flashstacks/facial-recognition | 93998bc17819ff8862603cd2660f2abc5c356d24 | [
"MIT"
] | null | null | null | import cv2
import os
camera_url = "rtsp://admin:Villano0603@192.168.1.102"
#camera_url = "twitch.tv/elded"
dataPath = 'C:/Users/carl2/Desktop/Reconocimiento/Datos' #Cambia a la ruta donde hayas almacenado Data
imagePaths = os.listdir(dataPath)
print('imagePaths=',imagePaths)
#face_recognizer = cv2.face.EigenFaceReco... | 34.773333 | 103 | 0.686733 | import cv2
import os
camera_url = "rtsp://admin:Villano0603@192.168.1.102"
dataPath = 'C:/Users/carl2/Desktop/Reconocimiento/Datos' imagePaths = os.listdir(dataPath)
print('imagePaths=',imagePaths)
face_recognizer = cv2.face.LBPHFaceRecognizer_create()
face_recognizer.read('modeloLBPHFace.xml')
cap = cv2.VideoCapt... | true | true |
f77a23e13091efba47de091ef39d90c7080af789 | 2,198 | py | Python | snippets/create_synthetic_data.py | jackdbd/hdf5-pydata-munich | 3f814c7f58ac460f7bdadfc8deed9d9d44269dcf | [
"MIT"
] | 12 | 2017-12-25T16:36:17.000Z | 2021-05-23T00:58:21.000Z | snippets/create_synthetic_data.py | jackdbd/hdf5-pydata-munich | 3f814c7f58ac460f7bdadfc8deed9d9d44269dcf | [
"MIT"
] | null | null | null | snippets/create_synthetic_data.py | jackdbd/hdf5-pydata-munich | 3f814c7f58ac460f7bdadfc8deed9d9d44269dcf | [
"MIT"
] | 5 | 2017-12-22T12:10:14.000Z | 2020-10-06T07:53:57.000Z | """Create synthetic data to benchmark PyTables queries.
Usage
-----
# Generate 10 datasets of synthetic data
python create_synthetic_data.py -n 1000000
"""
import os
import argparse
import time
import tables as tb
import numpy as np
class SyntheticDataDescription(tb.IsDescription):
unsigned_int_field = tb.UInt8C... | 30.527778 | 84 | 0.654231 | import os
import argparse
import time
import tables as tb
import numpy as np
class SyntheticDataDescription(tb.IsDescription):
unsigned_int_field = tb.UInt8Col(pos=0)
int_field = tb.Int32Col(pos=1)
float_field = tb.Float32Col(pos=2)
bool_field = tb.BoolCol(pos=3)
def fill_table(table, data):
num... | true | true |
f77a2495454bbec2497fc587fc988dd59ca95018 | 382 | py | Python | nsd1803/python/day01/login.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1803/python/day01/login.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1803/python/day01/login.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | # https://www.jianshu.com/c/00c61372c46a
username = input('username: ')
print('Welcome', username)
print('Welcome ' + username)
# PEP8
a = 10 + 5 # 变量赋值,自右向左进行
a = a + 10 # 可以简化为以下形式
a += 10
# b += 10 # 错误,因为等价于b = b + 10,b没有提前赋值
print(5 / 2) # 2.5
print(5 // 2) # 2
print(5 % 2) # 只要余数,模运算,1
print(2 ** 3) # ... | 15.28 | 40 | 0.575916 |
username = input('username: ')
print('Welcome', username)
print('Welcome ' + username)
a = 10 + 5 a = a + 10 a += 10
print(5 / 2) print(5 // 2) print(5 % 2) print(2 ** 3)
20 > 10 > 5 10 > 10 and 10 > 5
| true | true |
f77a250ede892ac24946fff24da0a7a5280c73ff | 32,270 | py | Python | tests/python/unittest/test_arith_iter_affine_map.py | LEA0317/incubator-tvm | de21c8f2ef507587fdcc99b851404de5aeeb5a16 | [
"Apache-2.0"
] | 90 | 2021-11-30T11:58:10.000Z | 2022-03-31T02:24:04.000Z | tests/python/unittest/test_arith_iter_affine_map.py | LEA0317/incubator-tvm | de21c8f2ef507587fdcc99b851404de5aeeb5a16 | [
"Apache-2.0"
] | 64 | 2021-11-22T23:58:23.000Z | 2022-03-31T03:19:22.000Z | tests/python/unittest/test_arith_iter_affine_map.py | LEA0317/incubator-tvm | de21c8f2ef507587fdcc99b851404de5aeeb5a16 | [
"Apache-2.0"
] | 27 | 2021-12-09T22:39:27.000Z | 2022-03-24T23:21:48.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 u... | 34.366347 | 99 | 0.558351 | import tvm
import tvm.testing
from tvm import te
from tvm.tir import floormod, floordiv
def ifuse(inputs, pred_extent=None):
value, extent = 0, 1
for i, ext in inputs:
value = value * ext + i
extent = extent * ext
return value, extent if pred_extent is None else pred_extent
def isplit(ax... | true | true |
f77a259f2a364cef46ccb216dcb41123fd5b75fd | 2,068 | py | Python | signals/perturbations/step_perturbation.py | camilorey/signals_package | fe28fe9b4f791a951fb5249ab0da5efbcd54fd5c | [
"MIT"
] | 1 | 2022-01-03T19:39:45.000Z | 2022-01-03T19:39:45.000Z | signals/perturbations/step_perturbation.py | camilorey/signals_package | fe28fe9b4f791a951fb5249ab0da5efbcd54fd5c | [
"MIT"
] | null | null | null | signals/perturbations/step_perturbation.py | camilorey/signals_package | fe28fe9b4f791a951fb5249ab0da5efbcd54fd5c | [
"MIT"
] | null | null | null | import warnings
import numpy as np
from .perturbation import Perturbation
class StepPerturbation(Perturbation):
"""
This class will simulate a Step perturbation, with a support beginning at _t0 and ending in _t0+_support,
that causes a Petrurbation in the form a Step Function.
Parameters to construct ... | 44.956522 | 109 | 0.63588 | import warnings
import numpy as np
from .perturbation import Perturbation
class StepPerturbation(Perturbation):
def construct_function(self,kwargs:dict):
if 'step' in kwargs:
w = kwargs['step']
is_in_support = self.check_parameter_in_support(w)
if not is_in_support:
... | true | true |
f77a2638c399177a5cef92ecfb64bc95954c0207 | 1,929 | py | Python | vsts/vsts/git/v4_1/models/item_model.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/git/v4_1/models/item_model.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/git/v4_1/models/item_model.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 38.58 | 128 | 0.546397 |
from msrest.serialization import Model
class ItemModel(Model):
_attribute_map = {
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
'content': {'key': 'content', 'type': 'str'},
'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'},
'is_folder': {'key... | true | true |
f77a26a5653a3a7b33178aa0fa3b7ee2e3ac4177 | 464 | py | Python | src/accelerate/__init__.py | Pandinosaurus/accelerate | 6ffab178accebda485295bddf8eb6bf436ff698f | [
"Apache-2.0"
] | null | null | null | src/accelerate/__init__.py | Pandinosaurus/accelerate | 6ffab178accebda485295bddf8eb6bf436ff698f | [
"Apache-2.0"
] | null | null | null | src/accelerate/__init__.py | Pandinosaurus/accelerate | 6ffab178accebda485295bddf8eb6bf436ff698f | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
__version__ = "0.6.0.dev0"
from .accelerator import Accelerator
from .kwargs_handlers import DistributedDataParallelKwargs, GradScalerKwargs
from .l... | 38.666667 | 77 | 0.806034 | # module, but to preserve other warnings. So, don't check this module at all.
__version__ = "0.6.0.dev0"
from .accelerator import Accelerator
from .kwargs_handlers import DistributedDataParallelKwargs, GradScalerKwargs
from .launchers import debug_launcher, notebook_launcher
from .state import DistributedType
from .u... | true | true |
f77a282b20cb407897ed7c7866512e6bda80aea8 | 1,518 | py | Python | generated-libraries/python/netapp/ntdtest/default_get_iter_key_td.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | 2 | 2017-03-28T15:31:26.000Z | 2018-08-16T22:15:18.000Z | generated-libraries/python/netapp/ntdtest/default_get_iter_key_td.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | generated-libraries/python/netapp/ntdtest/default_get_iter_key_td.py | radekg/netapp-ontap-lib-get | 6445ebb071ec147ea82a486fbe9f094c56c5c40d | [
"MIT"
] | null | null | null | from netapp.netapp_object import NetAppObject
class DefaultGetIterKeyTd(NetAppObject):
"""
Key typedef for table ntdtest_multiple_with_default
"""
_key_2 = None
@property
def key_2(self):
"""
Field sfield3
"""
return self._key_2
@key_2.setter
def key... | 23.353846 | 87 | 0.513834 | from netapp.netapp_object import NetAppObject
class DefaultGetIterKeyTd(NetAppObject):
_key_2 = None
@property
def key_2(self):
return self._key_2
@key_2.setter
def key_2(self, val):
if val != None:
self.validate('key_2', val)
self._key_2 = val
_key... | true | true |
f77a28e542c0da4e8421795cb2d9e8dd22653f0e | 6,017 | py | Python | lib/layer_utils/proposal_target_layer.py | vietlinhtspt/NewFasterRCNN | 3c85af51e6631a3710736f05add93549f09a315f | [
"MIT"
] | 4,101 | 2017-02-06T23:46:39.000Z | 2022-03-27T08:39:10.000Z | human-detection/lib/layer_utils/proposal_target_layer.py | XiaoqingWang/AlphaPose | c2a1f51bfe8445662966d4cf62a098d8d3b373c4 | [
"Apache-2.0"
] | 495 | 2017-02-08T03:12:03.000Z | 2022-03-28T01:49:01.000Z | human-detection/lib/layer_utils/proposal_target_layer.py | XiaoqingWang/AlphaPose | c2a1f51bfe8445662966d4cf62a098d8d3b373c4 | [
"Apache-2.0"
] | 1,913 | 2017-02-08T02:09:20.000Z | 2022-03-29T07:59:11.000Z | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick, Sean Bell and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from... | 39.326797 | 100 | 0.72694 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import numpy.random as npr
from model.config import cfg
from model.bbox_transform import bbox_transform
from utils.cython_bbox import bbox_overlaps
def proposal_target_layer(rpn_rois, rpn_s... | true | true |
f77a2904dabc80c62b886162149c8847c9807069 | 971 | py | Python | messagebird/base_list.py | victormb84/python-rest-api | 6e0b6b7a54183bb5383b43ac95c12da9a76d2108 | [
"BSD-2-Clause"
] | null | null | null | messagebird/base_list.py | victormb84/python-rest-api | 6e0b6b7a54183bb5383b43ac95c12da9a76d2108 | [
"BSD-2-Clause"
] | 1 | 2019-09-10T08:52:33.000Z | 2019-09-10T08:52:33.000Z | messagebird/base_list.py | victormb84/python-rest-api | 6e0b6b7a54183bb5383b43ac95c12da9a76d2108 | [
"BSD-2-Clause"
] | null | null | null | from messagebird.base import Base
class Links(Base):
def __init__(self):
self.first = None
self.previous = None
self.next = None
self.last = None
class BaseList(Base):
def __init__(self, item_type):
"""When setting items, they are instantiated as objects of type ite... | 21.108696 | 85 | 0.581874 | from messagebird.base import Base
class Links(Base):
def __init__(self):
self.first = None
self.previous = None
self.next = None
self.last = None
class BaseList(Base):
def __init__(self, item_type):
self.limit = None
self.offset = None
self.count = N... | true | true |
f77a2935aca856f682209112f60e4a50e14e95a4 | 1,630 | py | Python | tests/test_model_function.py | simonzabrocki/GraphModels | b43e44a189d663364ae08de9a1d1305320854d63 | [
"MIT"
] | null | null | null | tests/test_model_function.py | simonzabrocki/GraphModels | b43e44a189d663364ae08de9a1d1305320854d63 | [
"MIT"
] | null | null | null | tests/test_model_function.py | simonzabrocki/GraphModels | b43e44a189d663364ae08de9a1d1305320854d63 | [
"MIT"
] | null | null | null | import pytest
from GraphModels.graphmodels.graphmodel import GraphModel
nodes_1 = {
'In_1': {'type': 'input',
'unit': '1',
'name': 'Input 1'},
'Par_1': {'type': 'parameter',
'unit': '1',
'name': 'Parameter 1'},
'Var_1': {'type': 'variable',
... | 27.627119 | 90 | 0.477301 | import pytest
from GraphModels.graphmodels.graphmodel import GraphModel
nodes_1 = {
'In_1': {'type': 'input',
'unit': '1',
'name': 'Input 1'},
'Par_1': {'type': 'parameter',
'unit': '1',
'name': 'Parameter 1'},
'Var_1': {'type': 'variable',
... | true | true |
f77a2945fb3eab5f27c35a8f86541756f251a851 | 919 | py | Python | guests/migrations/0017_auto_20190220_0013.py | kdriemeyer/django-wedding-website | 7f2f7c85a93921e3c6265305166ab26fda8d6dd6 | [
"Apache-2.0"
] | 1 | 2019-01-26T22:49:58.000Z | 2019-01-26T22:49:58.000Z | guests/migrations/0017_auto_20190220_0013.py | kdriemeyer/django-wedding-website | 7f2f7c85a93921e3c6265305166ab26fda8d6dd6 | [
"Apache-2.0"
] | null | null | null | guests/migrations/0017_auto_20190220_0013.py | kdriemeyer/django-wedding-website | 7f2f7c85a93921e3c6265305166ab26fda8d6dd6 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.5 on 2019-02-20 00:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guests', '0016_party_rehearsal_dinner'),
]
operations = [
migrations.AddField(
model_name='guest',
name='allergies',... | 31.689655 | 150 | 0.566921 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('guests', '0016_party_rehearsal_dinner'),
]
operations = [
migrations.AddField(
model_name='guest',
name='allergies',
field=models.CharField(blank=True, ... | true | true |
f77a29eab815c410efa01c3cec116e622f93466e | 404 | py | Python | edukasi/migrations/0032_auto_20210705_0617.py | irzaip/trampill_py | 74310e44864ab1bb8b20f529c21079cbd8076875 | [
"MIT"
] | 2 | 2020-11-21T04:25:11.000Z | 2021-07-07T08:26:10.000Z | edukasi/migrations/0032_auto_20210705_0617.py | irzaip/trampill_py | 74310e44864ab1bb8b20f529c21079cbd8076875 | [
"MIT"
] | 7 | 2021-07-04T14:55:48.000Z | 2021-09-08T12:51:22.000Z | edukasi/migrations/0032_auto_20210705_0617.py | irzaip/trampill_py | 74310e44864ab1bb8b20f529c21079cbd8076875 | [
"MIT"
] | 1 | 2021-09-10T06:05:49.000Z | 2021-09-10T06:05:49.000Z | # Generated by Django 3.1.2 on 2021-07-05 06:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('edukasi', '0031_auto_20210704_1017'),
]
operations = [
migrations.AlterField(
model_name='kegiatan',
name='url_donas... | 21.263158 | 62 | 0.608911 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('edukasi', '0031_auto_20210704_1017'),
]
operations = [
migrations.AlterField(
model_name='kegiatan',
name='url_donasi',
field=models.CharField(max_lengt... | true | true |
f77a2a24db7f2d50eab931ae687bdb2a7fe93b17 | 2,711 | py | Python | cowrie/ssh/connection.py | SecPascal/cowrie | 9dc70d788a65f087e8cebbb2e272dacf90928c80 | [
"BSD-3-Clause"
] | 3 | 2018-11-15T07:20:24.000Z | 2021-06-10T03:34:56.000Z | cowrie/ssh/connection.py | r3p3r/micheloosterhof-cowrie | 58d36cf1563eeaf3e660bff83c89ec0dc993c3a2 | [
"BSD-3-Clause"
] | null | null | null | cowrie/ssh/connection.py | r3p3r/micheloosterhof-cowrie | 58d36cf1563eeaf3e660bff83c89ec0dc993c3a2 | [
"BSD-3-Clause"
] | 8 | 2015-12-17T05:41:51.000Z | 2019-09-27T05:06:37.000Z | # Copyright (c) 2015 Michel Oosterhof <michel@oosterhof.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, th... | 41.075758 | 118 | 0.741055 |
from __future__ import division, absolute_import
import struct
from twisted.conch.ssh import connection, common
from twisted.python import log
from twisted.internet import defer
MSG_CHANNEL_SUCCESS = 99
class CowrieSSHConnection(connection.SSHConnection):
def ssh_CHANNEL_REQUEST(self, packet):
localCh... | true | true |
f77a2a9733986f0647e27eaece6a7e319fc0b8be | 2,079 | py | Python | test/admire_work_test.py | fausecteam/faustctf-2017-toilet | 825d4bf82749ca56e104e9d9b5ecd241a75eb0b6 | [
"0BSD"
] | null | null | null | test/admire_work_test.py | fausecteam/faustctf-2017-toilet | 825d4bf82749ca56e104e9d9b5ecd241a75eb0b6 | [
"0BSD"
] | null | null | null | test/admire_work_test.py | fausecteam/faustctf-2017-toilet | 825d4bf82749ca56e104e9d9b5ecd241a75eb0b6 | [
"0BSD"
] | null | null | null | from util import *
from test import BasicTest
class AdmireWorkTest(BasicTest):
def __init__(self, s):
self._name = "Admire Work Test"
self._socket = s
def run_all_tests(self):
self.admire_before_login()
self.admire_before_drop()
self.admire_after_drop()
self.adm... | 37.125 | 70 | 0.618086 | from util import *
from test import BasicTest
class AdmireWorkTest(BasicTest):
def __init__(self, s):
self._name = "Admire Work Test"
self._socket = s
def run_all_tests(self):
self.admire_before_login()
self.admire_before_drop()
self.admire_after_drop()
self.adm... | true | true |
f77a2a992b7e05eea9bf6f756b782258c66cc21c | 2,796 | py | Python | fabfile/es.py | iris-dni/iris-backend | 680aadb1d9dd02e031b1902a4f9ef19440959465 | [
"Apache-2.0"
] | 2 | 2017-08-28T14:26:54.000Z | 2017-09-15T20:49:35.000Z | fabfile/es.py | iris-dni/iris-backend | 680aadb1d9dd02e031b1902a4f9ef19440959465 | [
"Apache-2.0"
] | 27 | 2016-09-16T09:44:44.000Z | 2017-03-27T12:05:31.000Z | fabfile/es.py | iris-dni/iris-backend | 680aadb1d9dd02e031b1902a4f9ef19440959465 | [
"Apache-2.0"
] | null | null | null | import os
from fabric.api import run, sudo, env, task, put, cd
import fabtools.python
import fabtools.rpm
import fabtools.files
env.forward_agent = True
env.user = 'admin'
TMP_VENV_DIR = '/tmp/copyIndex'
SRC_DIR = os.path.join(TMP_VENV_DIR, 'src')
REMOTE_PY = os.path.join(TMP_VENV_DIR, 'bin', 'python')
HERE = os.p... | 27.683168 | 73 | 0.584406 | import os
from fabric.api import run, sudo, env, task, put, cd
import fabtools.python
import fabtools.rpm
import fabtools.files
env.forward_agent = True
env.user = 'admin'
TMP_VENV_DIR = '/tmp/copyIndex'
SRC_DIR = os.path.join(TMP_VENV_DIR, 'src')
REMOTE_PY = os.path.join(TMP_VENV_DIR, 'bin', 'python')
HERE = os.p... | true | true |
f77a2b120daced3f5ddd7f408e4a624987fab2e3 | 1,783 | py | Python | homeassistant/components/lutron/binary_sensor.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | homeassistant/components/lutron/binary_sensor.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 58 | 2020-08-03T07:33:02.000Z | 2022-03-31T06:02:05.000Z | homeassistant/components/lutron/binary_sensor.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Support for Lutron Powr Savr occupancy sensors."""
from pylutron import OccupancyGroup
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
BinarySensorEntity,
)
from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice
def setup_platform(hass, config, add_entities, discovery_... | 32.418182 | 84 | 0.700505 | from pylutron import OccupancyGroup
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_OCCUPANCY,
BinarySensorEntity,
)
from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice
def setup_platform(hass, config, add_entities, discovery_info=None):
if discovery_info is None:
ret... | true | true |
f77a2bccfeefe5524a34df76e3d5909b62815d4e | 3,734 | py | Python | AI-env/lib/python3.7/site-packages/paramiko/__init__.py | parth5795/iOT-benchmarking | 6dfc95907d85f50ee2c68592ce78b4212be5f823 | [
"MIT"
] | 12 | 2018-07-18T05:45:18.000Z | 2020-02-19T21:27:33.000Z | AI-env/lib/python3.7/site-packages/paramiko/__init__.py | parth5795/iOT-benchmarking | 6dfc95907d85f50ee2c68592ce78b4212be5f823 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | AI-env/lib/python3.7/site-packages/paramiko/__init__.py | parth5795/iOT-benchmarking | 6dfc95907d85f50ee2c68592ce78b4212be5f823 | [
"MIT"
] | 6 | 2019-02-20T00:42:29.000Z | 2020-08-08T17:01:43.000Z | # Copyright (C) 2003-2011 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | 28.503817 | 79 | 0.760846 |
import sys
from paramiko._version import __version__, __version_info__
from paramiko.transport import SecurityOptions, Transport
from paramiko.client import (
SSHClient,
MissingHostKeyPolicy,
AutoAddPolicy,
RejectPolicy,
WarningPolicy,
)
from paramiko.auth_handler import AuthHandler
from paramiko.s... | true | true |
f77a2c301b20308b92739d6f1ccdc021a6e9495e | 11,044 | py | Python | noxfile.py | Z3R0O2/Tanjun | 566584f1abaafc1c7538f204e0159e74d0b80182 | [
"BSD-3-Clause"
] | 1 | 2022-03-14T06:15:35.000Z | 2022-03-14T06:15:35.000Z | noxfile.py | Z3R0O2/Tanjun | 566584f1abaafc1c7538f204e0159e74d0b80182 | [
"BSD-3-Clause"
] | null | null | null | noxfile.py | Z3R0O2/Tanjun | 566584f1abaafc1c7538f204e0159e74d0b80182 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# cython: language_level=3
# BSD 3-Clause License
#
# Copyright (c) 2020-2022, Faster Speeding
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... | 39.726619 | 120 | 0.679192 | from __future__ import annotations
import pathlib
import tempfile
import nox
nox.options.sessions = ["reformat", "lint", "spell-check", "type-check", "test", "verify-types"] GENERAL_TARGETS = ["./examples", "./noxfile.py", "./tanjun", "./tests"]
PYTHON_VERSIONS = ["3.9", "3.10"]
def install_requirements(session:... | true | true |
f77a2dfc92ecc94d4f2c43605e5bcf3db67eb2f7 | 1,658 | py | Python | core/modules/whois_domain.py | samyoyo/blackowl | d3a40954919cc597bb56fbc075c4f2f4368de3fb | [
"MIT"
] | 7 | 2018-07-12T08:49:31.000Z | 2021-02-17T22:32:23.000Z | core/modules/whois_domain.py | TheRipperJhon/Black_Owl | d3a40954919cc597bb56fbc075c4f2f4368de3fb | [
"MIT"
] | null | null | null | core/modules/whois_domain.py | TheRipperJhon/Black_Owl | d3a40954919cc597bb56fbc075c4f2f4368de3fb | [
"MIT"
] | 3 | 2019-07-16T15:41:08.000Z | 2021-01-12T18:35:07.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#description:Whois information for domain.
from core.lib import colors
from core.lib import completer
import readline
#requirements
import pythonwhois
#colors
C = colors.Palette()
class module_element(object):
def __init__(self):
self.title = "Whois Domain... | 25.507692 | 90 | 0.508444 |
from core.lib import colors
from core.lib import completer
import readline
import pythonwhois
C = colors.Palette()
class module_element(object):
def __init__(self):
self.title = "Whois Domain\n"
self.require = {
'domain':{'value':'', 'required':'yes'}
}
self.export... | false | true |
f77a2e67cdb84d5f534e218d0a7a916b09886345 | 8,684 | py | Python | CODE/pc0_224ver.py | redkfa/Dual-model-CNN-keras | 0ee8ff4778bc213a0336a166c5c61d8ae067200a | [
"MIT"
] | null | null | null | CODE/pc0_224ver.py | redkfa/Dual-model-CNN-keras | 0ee8ff4778bc213a0336a166c5c61d8ae067200a | [
"MIT"
] | null | null | null | CODE/pc0_224ver.py | redkfa/Dual-model-CNN-keras | 0ee8ff4778bc213a0336a166c5c61d8ae067200a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 13 05:13:27 2018
@author: s207
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 10 02:43:10 2018
@author: s207
"""
from keras.callbacks import TensorBoard
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Conv2D, MaxPooling2D
from keras... | 38.595556 | 128 | 0.598227 |
from keras.callbacks import TensorBoard
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Conv2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense
from keras import backend as K
from keras.applications.resnet50 import ResNet50
from keras.models import Model
from... | true | true |
f77a2eae0f34671426a6f9cf8472c881f0c204e6 | 5,980 | py | Python | django/contrib/gis/feeds.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | 1 | 2015-05-16T13:13:06.000Z | 2015-05-16T13:13:06.000Z | django/contrib/gis/feeds.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/feeds.py | PirosB3/django | 9b729ddd8f2040722971ccfb3b12f7d8162633d1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C ... | 41.241379 | 101 | 0.598495 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
def georss_coords(self, coords):
return ' '.join('%f %f' % (coord[1], coord[0]) for coord in coords)
def... | true | true |
f77a2f22862e231af501d5fd1dce02c62db33c98 | 325 | py | Python | etc/fmc/stacks/examples/cmplex/metadata.py | logikone/form_my_cloud | 7e3a1a6e60faeb6d4bc32c79301d28401e19e8a0 | [
"Apache-2.0"
] | null | null | null | etc/fmc/stacks/examples/cmplex/metadata.py | logikone/form_my_cloud | 7e3a1a6e60faeb6d4bc32c79301d28401e19e8a0 | [
"Apache-2.0"
] | null | null | null | etc/fmc/stacks/examples/cmplex/metadata.py | logikone/form_my_cloud | 7e3a1a6e60faeb6d4bc32c79301d28401e19e8a0 | [
"Apache-2.0"
] | null | null | null | try:
import fmc
except:
import os
import sys
sys.path.append(os.getcwd())
import fmc
metadata = fmc.metadata(
Instances = {
"Description": "Description of Instances",
},
Databases = {
"Description": "Description of Databases",
},
... | 19.117647 | 54 | 0.516923 | try:
import fmc
except:
import os
import sys
sys.path.append(os.getcwd())
import fmc
metadata = fmc.metadata(
Instances = {
"Description": "Description of Instances",
},
Databases = {
"Description": "Description of Databases",
},
... | true | true |
f77a2f6d40b921c77a89b1528087a581ff7a2e74 | 27,664 | py | Python | modules/view.py | AgrinessEdgeIoT/dashboard-example | 1276159b83e6837c7fbe301f464663c2927cf7e5 | [
"MIT"
] | null | null | null | modules/view.py | AgrinessEdgeIoT/dashboard-example | 1276159b83e6837c7fbe301f464663c2927cf7e5 | [
"MIT"
] | 1 | 2018-10-08T18:37:51.000Z | 2018-10-08T18:37:51.000Z | modules/view.py | AgrinessEdgeIoT/dashboard-example | 1276159b83e6837c7fbe301f464663c2927cf7e5 | [
"MIT"
] | null | null | null | ######################### IMPORTS #########################
import ast # Abstract syntax trees
import json # JSON encoder and decoder
import pandas # Python data analysis library
import random ... | 50.3898 | 319 | 0.68544 |
import ast import json import pandas import random import time import ipywidgets as widgets
from modules import uti... | true | true |
f77a2f780a62380f8c09423f223063fbe72c3b85 | 1,190 | py | Python | grammar_productions/multiply_expression.py | puskini33/Calculator | 79cc0021e8c9b5235d6c57c2d721deb254d73a33 | [
"MIT"
] | null | null | null | grammar_productions/multiply_expression.py | puskini33/Calculator | 79cc0021e8c9b5235d6c57c2d721deb254d73a33 | [
"MIT"
] | null | null | null | grammar_productions/multiply_expression.py | puskini33/Calculator | 79cc0021e8c9b5235d6c57c2d721deb254d73a33 | [
"MIT"
] | null | null | null | from grammar_productions.production import Production
from grammar_productions.integer import Integer
class MultiplyExpression(Production):
def __init__(self, left_element, right_element):
self.left_element = left_element
self.right_element = right_element
def __repr__(self):
return ... | 38.387097 | 107 | 0.713445 | from grammar_productions.production import Production
from grammar_productions.integer import Integer
class MultiplyExpression(Production):
def __init__(self, left_element, right_element):
self.left_element = left_element
self.right_element = right_element
def __repr__(self):
return ... | true | true |
f77a2fabdd98991cf4bb273f8706e6e1f7fa01b0 | 10,893 | py | Python | metacells/pipeline/consistency.py | tanaylab/metacells | ecd957b306bd6af2fcfd56efb246ce15b0d8238a | [
"MIT"
] | 16 | 2021-06-19T03:03:06.000Z | 2022-03-21T20:47:15.000Z | metacells/pipeline/consistency.py | tanaylab/metacells | ecd957b306bd6af2fcfd56efb246ce15b0d8238a | [
"MIT"
] | 23 | 2021-03-17T09:38:04.000Z | 2022-03-02T11:04:56.000Z | metacells/pipeline/consistency.py | tanaylab/metacells | ecd957b306bd6af2fcfd56efb246ce15b0d8238a | [
"MIT"
] | 1 | 2021-12-02T21:28:11.000Z | 2021-12-02T21:28:11.000Z | '''
Split
-----
'''
from re import Pattern
from typing import Collection, Optional, Tuple, Union
import numpy as np
from anndata import AnnData
import metacells.parameters as pr
import metacells.tools as tl
import metacells.utilities as ut
from .direct import compute_direct_metacells
__all__ = [
'split_groups'... | 46.751073 | 107 | 0.667309 |
from re import Pattern
from typing import Collection, Optional, Tuple, Union
import numpy as np
from anndata import AnnData
import metacells.parameters as pr
import metacells.tools as tl
import metacells.utilities as ut
from .direct import compute_direct_metacells
__all__ = [
'split_groups',
'compute_group... | true | true |
f77a2fbc0b806ec8912010f6cbd8e8b6d7c094f6 | 13,926 | bzl | Python | intellij_platform_sdk/build_defs.bzl | blorente/intellij | 70902e7581dd1f560f6472a90e92f7b5ca6ec6b9 | [
"Apache-2.0"
] | null | null | null | intellij_platform_sdk/build_defs.bzl | blorente/intellij | 70902e7581dd1f560f6472a90e92f7b5ca6ec6b9 | [
"Apache-2.0"
] | null | null | null | intellij_platform_sdk/build_defs.bzl | blorente/intellij | 70902e7581dd1f560f6472a90e92f7b5ca6ec6b9 | [
"Apache-2.0"
] | null | null | null | """Convenience methods for plugin_api."""
# The current indirect ij_product mapping (eg. "intellij-latest")
INDIRECT_IJ_PRODUCTS = {
# Indirect ij_product mapping for internal Blaze Plugin
"intellij-latest": "intellij-2021.2",
"intellij-latest-mac": "intellij-2021.2-mac",
"intellij-beta": "intellij-202... | 34.902256 | 113 | 0.621499 |
INDIRECT_IJ_PRODUCTS = {
"intellij-latest": "intellij-2021.2",
"intellij-latest-mac": "intellij-2021.2-mac",
"intellij-beta": "intellij-2021.2",
"intellij-under-dev": "intellij-2021.3",
"intellij-ue-latest": "intellij-ue-2021.2",
"intellij-ue-latest-mac": "intellij-ue-2021.2-mac",
"inte... | true | true |
f77a30167b92635226c9d22a5a1cdb87d61491e4 | 10,519 | py | Python | aqt/utils/config_schema_utils_test.py | anshita22/google-research | 8d9880136708f600b3f1762d65ab8d018eff24f8 | [
"Apache-2.0"
] | 1 | 2022-03-24T03:00:52.000Z | 2022-03-24T03:00:52.000Z | aqt/utils/config_schema_utils_test.py | anshita22/google-research | 8d9880136708f600b3f1762d65ab8d018eff24f8 | [
"Apache-2.0"
] | null | null | null | aqt/utils/config_schema_utils_test.py | anshita22/google-research | 8d9880136708f600b3f1762d65ab8d018eff24f8 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.908772 | 80 | 0.684666 |
import json
from absl.testing import absltest
from absl.testing import parameterized
import ml_collections
from aqt.utils import config_schema_utils
class MakeReferenceRecursiveTest(absltest.TestCase):
def test_scalar_fields(self):
config = ml_collections.ConfigDict({'parent_field': 1})
config.child_fi... | true | true |
f77a31df27f4ccbf325af6f46da9a834a37cf012 | 2,832 | py | Python | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy_helpers/astropy_helpers/sphinx/ext/changelog_links.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | 303 | 2016-03-03T00:44:37.000Z | 2022-03-14T03:43:38.000Z | NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy_helpers/astropy_helpers/sphinx/ext/changelog_links.py | sahirsharma/Martian | 062e9b47849512863c16713811f347ad7e121b56 | [
"MIT"
] | 52 | 2016-02-26T21:41:31.000Z | 2021-06-27T08:33:51.000Z | astropy_helpers/astropy_helpers/sphinx/ext/changelog_links.py | brechmos-stsci/deleteme | 02590bbe715750c908b6d8013b3ec935eeaf4040 | [
"BSD-3-Clause"
] | 67 | 2016-03-03T22:38:35.000Z | 2022-01-12T08:03:47.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This sphinx extension makes the issue numbers in the changelog into links to
GitHub issues.
"""
from __future__ import print_function
import re
from docutils.nodes import Text, reference
BLOCK_PATTERN = re.compile('\[#.+\]', flags=re.DOTALL)
ISSUE_... | 35.848101 | 94 | 0.627119 |
from __future__ import print_function
import re
from docutils.nodes import Text, reference
BLOCK_PATTERN = re.compile('\[#.+\]', flags=re.DOTALL)
ISSUE_PATTERN = re.compile('#[0-9]+')
def process_changelog_links(app, doctree, docname):
for rex in app.changelog_links_rexes:
if rex.match(docname):
... | true | true |
f77a344cfd8f965d247c5efbde92205471ab8bb6 | 3,048 | py | Python | subalign/extract.py | ychalier/subalign | 6dda4a7e37c4513a547fdd3999653b71ca778098 | [
"MIT"
] | null | null | null | subalign/extract.py | ychalier/subalign | 6dda4a7e37c4513a547fdd3999653b71ca778098 | [
"MIT"
] | null | null | null | subalign/extract.py | ychalier/subalign | 6dda4a7e37c4513a547fdd3999653b71ca778098 | [
"MIT"
] | null | null | null | """Wrapper for mkvmerge, mkvextract and ffmpeg tools"""
import os
import json
import subprocess
import logging
def gather_video_properties(mkvmerge, video_path):
"""Use the mkvmerge --identify option to extract tracks information from a
video file.
"""
logging.debug(
"Extracting video prope... | 30.787879 | 87 | 0.610236 | import os
import json
import subprocess
import logging
def gather_video_properties(mkvmerge, video_path):
logging.debug(
"Extracting video properties of %s",
os.path.realpath(video_path)
)
command = [mkvmerge, "-J", os.path.realpath(video_path)]
process = subprocess.Popen(command, stdo... | true | true |
f77a3479fbb0ecbba9c08879ba7cf21a3aae9e9b | 290 | py | Python | tests/conftest.py | chingc/euler-python | e963752969cfa7a939ef6a8408f5628ce3c96cae | [
"MIT"
] | null | null | null | tests/conftest.py | chingc/euler-python | e963752969cfa7a939ef6a8408f5628ce3c96cae | [
"MIT"
] | null | null | null | tests/conftest.py | chingc/euler-python | e963752969cfa7a939ef6a8408f5628ce3c96cae | [
"MIT"
] | null | null | null | """Fixtures"""
from pathlib import Path
import pytest
_TEST_FILES = Path(__file__).parent / "test_files"
@pytest.fixture
def p008() -> str:
"""Problem 008 data."""
with open(_TEST_FILES / "problem_008.txt", "r") as f:
return "".join([x.strip() for x in f.readlines()])
| 19.333333 | 58 | 0.641379 |
from pathlib import Path
import pytest
_TEST_FILES = Path(__file__).parent / "test_files"
@pytest.fixture
def p008() -> str:
with open(_TEST_FILES / "problem_008.txt", "r") as f:
return "".join([x.strip() for x in f.readlines()])
| true | true |
f77a34fdcac09b5ab05c2b56806433b3a5955442 | 905 | py | Python | experiments/notebook-download-button/notebook_download_button/handlers.py | crosscompute/jupyterlab-crosscompute | 034515c4502667a84ff0fbfce90f5118d1187598 | [
"BSD-3-Clause"
] | null | null | null | experiments/notebook-download-button/notebook_download_button/handlers.py | crosscompute/jupyterlab-crosscompute | 034515c4502667a84ff0fbfce90f5118d1187598 | [
"BSD-3-Clause"
] | 4 | 2022-01-28T21:35:36.000Z | 2022-03-01T17:16:07.000Z | experiments/notebook-download-button/notebook_download_button/handlers.py | crosscompute/crosscompute-jupyterlab-extensions | 6e8400768cd9e9456626aa12a1e22ed921fd3eb3 | [
"BSD-3-Clause"
] | null | null | null | import json
from notebook.base.handlers import APIHandler
from notebook.utils import url_path_join
import tornado
class RouteHandler(APIHandler):
# The following decorator should be present on all verb methods (head, get, post,
# patch, put, delete, options) to ensure only authorized user can request the
... | 33.518519 | 105 | 0.699448 | import json
from notebook.base.handlers import APIHandler
from notebook.utils import url_path_join
import tornado
class RouteHandler(APIHandler):
@tornado.web.authenticated
def get(self, path):
google_zip_file_uri = 'https://storage.googleapis.com/crosscompute-20200929/example-20200929.zip... | true | true |
f77a354827e2fa12379535b24e9963771ff98613 | 10,155 | py | Python | homework/hw1/proof.py | Notgnoshi/natural-computing | af6e10aaa4efcc6787bd5f71fb43fb66e67154ce | [
"MIT"
] | null | null | null | homework/hw1/proof.py | Notgnoshi/natural-computing | af6e10aaa4efcc6787bd5f71fb43fb66e67154ce | [
"MIT"
] | null | null | null | homework/hw1/proof.py | Notgnoshi/natural-computing | af6e10aaa4efcc6787bd5f71fb43fb66e67154ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import random
trivially = [
"Obviously",
"Clearly",
"Anyone can see that",
"Trivially",
"Indubitably",
"It follows that",
"Evidently",
"By basic applications of previously proven lemmas,",
"The proof is left to the reader that",
"It goes without saying tha... | 38.759542 | 111 | 0.662334 | import random
trivially = [
"Obviously",
"Clearly",
"Anyone can see that",
"Trivially",
"Indubitably",
"It follows that",
"Evidently",
"By basic applications of previously proven lemmas,",
"The proof is left to the reader that",
"It goes without saying that",
"Consequently",... | true | true |
f77a354ef606bed93aa0def556eb89995dbe00f4 | 192 | py | Python | src/apps/transfer/urls.py | suranig/django-coins-transfer | f4fb83609d35aa63905d73b500b896355f887770 | [
"MIT"
] | null | null | null | src/apps/transfer/urls.py | suranig/django-coins-transfer | f4fb83609d35aa63905d73b500b896355f887770 | [
"MIT"
] | 10 | 2019-10-21T14:12:28.000Z | 2022-02-10T10:32:55.000Z | src/apps/transfer/urls.py | suranig/django-coins-transfer | f4fb83609d35aa63905d73b500b896355f887770 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import TransferListCreateAPIView
urlpatterns = [
path('transfers/',
TransferListCreateAPIView.as_view(),
name='transfers'),
]
| 17.454545 | 45 | 0.692708 | from django.urls import path
from .views import TransferListCreateAPIView
urlpatterns = [
path('transfers/',
TransferListCreateAPIView.as_view(),
name='transfers'),
]
| true | true |
f77a3647fd3547e5211b2130d1ada07e6c67b00b | 5,607 | py | Python | rayml/tests/component_tests/test_exponential_smoothing_regressor.py | gcode-ai/rayml | 92c4f3c6041f465fee27a6c03bd7959c4ef21124 | [
"BSD-3-Clause"
] | null | null | null | rayml/tests/component_tests/test_exponential_smoothing_regressor.py | gcode-ai/rayml | 92c4f3c6041f465fee27a6c03bd7959c4ef21124 | [
"BSD-3-Clause"
] | null | null | null | rayml/tests/component_tests/test_exponential_smoothing_regressor.py | gcode-ai/rayml | 92c4f3c6041f465fee27a6c03bd7959c4ef21124 | [
"BSD-3-Clause"
] | null | null | null | from unittest.mock import patch
import numpy as np
import pandas as pd
import pytest
from rayml.model_family import ModelFamily
from rayml.pipelines.components import ExponentialSmoothingRegressor
from rayml.problem_types import ProblemTypes
pytestmark = [
pytest.mark.noncore_dependency,
pytest.mark.skip_dur... | 28.175879 | 83 | 0.701088 | from unittest.mock import patch
import numpy as np
import pandas as pd
import pytest
from rayml.model_family import ModelFamily
from rayml.pipelines.components import ExponentialSmoothingRegressor
from rayml.problem_types import ProblemTypes
pytestmark = [
pytest.mark.noncore_dependency,
pytest.mark.skip_dur... | true | true |
f77a36d06e9e98739837765cc1a916d3ce670ff9 | 658 | py | Python | services/document-manager/backend/app/constants.py | parc-jason/mds | 8f181a429442208a061ed72065b71e6c2bd0f76f | [
"Apache-2.0"
] | 14 | 2019-09-23T18:02:27.000Z | 2022-01-12T06:46:52.000Z | services/document-manager/backend/app/constants.py | parc-jason/mds | 8f181a429442208a061ed72065b71e6c2bd0f76f | [
"Apache-2.0"
] | 715 | 2019-10-01T21:04:57.000Z | 2022-03-31T21:31:20.000Z | services/document-manager/backend/app/constants.py | parc-jason/mds | 8f181a429442208a061ed72065b71e6c2bd0f76f | [
"Apache-2.0"
] | 9 | 2019-10-03T21:17:11.000Z | 2021-09-02T23:26:39.000Z | # Cache Timeouts
TIMEOUT_5_MINUTES = 300
TIMEOUT_60_MINUTES = 3600
TIMEOUT_24_HOURS = 86340
TIMEOUT_12_HOURS = 43140
# Cache keys
def FILE_UPLOAD_SIZE(document_guid): return f'document-manager:{document_guid}:file-size'
def FILE_UPLOAD_OFFSET(document_guid): return f'document-manager:{document_guid}:offset'
def FILE_U... | 41.125 | 89 | 0.779635 | TIMEOUT_5_MINUTES = 300
TIMEOUT_60_MINUTES = 3600
TIMEOUT_24_HOURS = 86340
TIMEOUT_12_HOURS = 43140
def FILE_UPLOAD_SIZE(document_guid): return f'document-manager:{document_guid}:file-size'
def FILE_UPLOAD_OFFSET(document_guid): return f'document-manager:{document_guid}:offset'
def FILE_UPLOAD_PATH(document_guid): ret... | true | true |
f77a38038bdf8ead80f0d86fa86eee3e8e71d82e | 616 | py | Python | jwtauth/database.py | Katzuno/BACKEND-Automation-Testing-with-Computer-Vision | ce7859b5811ce665c4597891b66399317d1af38f | [
"MIT"
] | 1 | 2020-07-16T05:34:34.000Z | 2020-07-16T05:34:34.000Z | jwtauth/database.py | Katzuno/BACKEND-Automation-Testing-with-Computer-Vision | ce7859b5811ce665c4597891b66399317d1af38f | [
"MIT"
] | null | null | null | jwtauth/database.py | Katzuno/BACKEND-Automation-Testing-with-Computer-Vision | ce7859b5811ce665c4597891b66399317d1af38f | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
DATABASE_URL = 'mysql+pymysql://root:@localhost/atcv'
engine = create_engine(DATABASE_URL, convert_unicode=True)
db_session = scoped_session(sessionmaker(autocommit=Fal... | 28 | 58 | 0.699675 | from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
DATABASE_URL = 'mysql+pymysql://root:@localhost/atcv'
engine = create_engine(DATABASE_URL, convert_unicode=True)
db_session = scoped_session(sessionmaker(autocommit=Fal... | true | true |
f77a39a81385c1514a02353847cd5aa8b13d0892 | 3,981 | py | Python | zerver/webhooks/trello/view/board_actions.py | roberthoenig/zulip | 5d6724345a8ba4896d21478be2e33e624f8ac8ab | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/trello/view/board_actions.py | roberthoenig/zulip | 5d6724345a8ba4896d21478be2e33e624f8ac8ab | [
"Apache-2.0"
] | null | null | null | zerver/webhooks/trello/view/board_actions.py | roberthoenig/zulip | 5d6724345a8ba4896d21478be2e33e624f8ac8ab | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Optional, Mapping, MutableMapping, Text, Tuple
from .exceptions import UnknownUpdateBoardAction
from .templates import TRELLO_SUBJECT_TEMPLATE, TRELLO_MESSAGE_TEMPLATE
SUPPORTED_BOARD_ACTIONS = [
u'removeMemberFromBoard',
u'addMemberToBoard',
u'createList',
u'updateBoard',... | 36.861111 | 113 | 0.720673 | from typing import Any, Dict, Optional, Mapping, MutableMapping, Text, Tuple
from .exceptions import UnknownUpdateBoardAction
from .templates import TRELLO_SUBJECT_TEMPLATE, TRELLO_MESSAGE_TEMPLATE
SUPPORTED_BOARD_ACTIONS = [
u'removeMemberFromBoard',
u'addMemberToBoard',
u'createList',
u'updateBoard',... | true | true |
f77a3b84dec530705a2cbc9b9ceb99eef9105a7b | 1,399 | py | Python | clearsky_detection/cities_mapper.py | hackingmaterials/duramat | 8e7c0efecc1af89cdc27a3ed569b8c5f1d985888 | [
"BSD-3-Clause-LBNL"
] | 4 | 2017-12-27T00:57:27.000Z | 2020-06-08T10:36:05.000Z | clearsky_detection/cities_mapper.py | hackingmaterials/duramat | 8e7c0efecc1af89cdc27a3ed569b8c5f1d985888 | [
"BSD-3-Clause-LBNL"
] | null | null | null | clearsky_detection/cities_mapper.py | hackingmaterials/duramat | 8e7c0efecc1af89cdc27a3ed569b8c5f1d985888 | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-05-22T01:12:53.000Z | 2019-05-22T01:12:53.000Z |
import pandas as pd
import os
geological_info = pd.read_json('./cities.json')
geological_info = geological_info.drop(['growth_from_2000_to_2013', 'population'], axis=1)
geological_info['city'] = geological_info['city'].apply(lambda x: x.replace(' ', ''))
geological_info['state'] = geological_info['state'].apply(lamb... | 32.534884 | 125 | 0.690493 |
import pandas as pd
import os
geological_info = pd.read_json('./cities.json')
geological_info = geological_info.drop(['growth_from_2000_to_2013', 'population'], axis=1)
geological_info['city'] = geological_info['city'].apply(lambda x: x.replace(' ', ''))
geological_info['state'] = geological_info['state'].apply(lamb... | true | true |
f77a3ba483eec720a1e43ab4e2fd704ac658ad38 | 9,420 | py | Python | samurai/likelihood.py | jlustigy/samurai | ed46e45600956581c94ae44d820e06c35c464962 | [
"MIT"
] | 1 | 2021-01-05T07:27:40.000Z | 2021-01-05T07:27:40.000Z | samurai/likelihood.py | jlustigy/samurai | ed46e45600956581c94ae44d820e06c35c464962 | [
"MIT"
] | null | null | null | samurai/likelihood.py | jlustigy/samurai | ed46e45600956581c94ae44d820e06c35c464962 | [
"MIT"
] | null | null | null | import numpy as np
import prior
import reparameterize
__all__ = ["lnprob", "lnprob_atmosphere"]
################################################################################
def lnprob(Y_array, *args):
"""
Log-probability function for mapping
Parameters
----------
Returns
-------
""... | 33.404255 | 163 | 0.630467 | import numpy as np
import prior
import reparameterize
__all__ = ["lnprob", "lnprob_atmosphere"]
def lnprob(Y_array, *args):
"""
Log-probability function for mapping
Parameters
----------
Returns
-------
"""
Obs_ij, Obsnoise_ij, Kernel_il, regularization, n_regparam, flip, verb... | false | true |
f77a3c0caaf22e9f4d3809e373f96deb58d8e91e | 4,694 | py | Python | selfdrive/controls/lib/long_mpc.py | Lotx-001/barghe_op | a768944e1d52349272a9a74973ce0630ce8860b4 | [
"MIT"
] | 6 | 2021-01-02T18:17:17.000Z | 2022-03-28T08:34:00.000Z | selfdrive/controls/lib/long_mpc.py | Lotx-001/barghe_op | a768944e1d52349272a9a74973ce0630ce8860b4 | [
"MIT"
] | 2 | 2021-07-26T03:09:47.000Z | 2021-12-21T13:46:47.000Z | selfdrive/controls/lib/long_mpc.py | Lotx-001/barghe_op | a768944e1d52349272a9a74973ce0630ce8860b4 | [
"MIT"
] | 17 | 2020-10-07T06:12:35.000Z | 2022-03-28T10:02:14.000Z | import os
import math
import cereal.messaging as messaging
from common.numpy_fast import clip, interp
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
from selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU
from selfdrive.controls.lib.longitudinal_mpc import libmpc_py
from sel... | 34.262774 | 113 | 0.670856 | import os
import math
import cereal.messaging as messaging
from common.numpy_fast import clip, interp
from selfdrive.swaglog import cloudlog
from common.realtime import sec_since_boot
from selfdrive.controls.lib.radar_helpers import _LEAD_ACCEL_TAU
from selfdrive.controls.lib.longitudinal_mpc import libmpc_py
from sel... | true | true |
f77a3d8a6d177248fd95bc8565ab3cdb1697fe23 | 1,287 | py | Python | tests/issue29.py | arlain23/pydensecrf | dee24b055d92dbbc906d50b282e0862d83c0cf80 | [
"MIT"
] | 1,765 | 2015-11-13T19:32:03.000Z | 2022-03-28T06:41:04.000Z | tests/issue29.py | arlain23/pydensecrf | dee24b055d92dbbc906d50b282e0862d83c0cf80 | [
"MIT"
] | 112 | 2015-11-23T21:52:01.000Z | 2022-02-20T13:29:43.000Z | tests/issue29.py | arlain23/pydensecrf | dee24b055d92dbbc906d50b282e0862d83c0cf80 | [
"MIT"
] | 461 | 2015-11-23T20:08:41.000Z | 2022-03-16T22:24:08.000Z | # probs of shape 3d image per class: Nb_classes x Height x Width x Depth
# assume the image has shape (69, 51, 72)
import numpy as np
import pydensecrf.densecrf as dcrf
from pydensecrf.utils import unary_from_softmax, create_pairwise_gaussian
###
#shape = (69, 51, 72)
#probs = np.random.randn(5, 69, 51).astype(np.flo... | 34.783784 | 102 | 0.737374 | import numpy as np
import pydensecrf.densecrf as dcrf
from pydensecrf.utils import unary_from_softmax, create_pairwise_gaussian
SHAPE, NLABELS = (69, 51, 72), 5
probs = np.random.randn(NLABELS, 68, 50).astype(np.float32) probs /= probs.sum(axis=0, keepdims=True)
d = dcrf.DenseCRF(np.prod(SHAPE), NLABELS)
d.setU... | true | true |
f77a3daba99475f614036a5a376cf64e7c38e67b | 2,260 | py | Python | aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/StopSyncingRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/StopSyncingRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-rds/aliyunsdkrds/request/v20140815/StopSyncingRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.242424 | 70 | 0.770796 |
from aliyunsdkcore.request import RpcRequest
class StopSyncingRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Rds', '2014-08-15', 'StopSyncing','rds')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
def set_ResourceOwnerId(self,ResourceOwnerId):
... | true | true |
f77a3e8bee8e5dd8b0db0f4fa65bef26f5f44553 | 4,309 | py | Python | plugins/modules/oci_database_gi_version_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_database_gi_version_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_database_gi_version_facts.py | sohwaje/oci-ansible-collection | 9e6b8cf55e596a96560710a457a7df05886fc59c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 27.8 | 109 | 0.672546 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_database_gi_version_facts
short_description: Fetches details about one or multi... | true | true |
f77a3ea2195263b73ef2657681100fb814576cf1 | 3,049 | py | Python | sequentiality.py | oxoxlol/api_key_detector | 459d969c04acc070ccebcb31666c6f65d173a59c | [
"Apache-2.0"
] | 26 | 2017-12-05T06:25:06.000Z | 2021-12-29T02:19:45.000Z | sequentiality.py | An0nYm0u5101/api_key_detector | e0ca322cda65e619479109fbcb8a7dda9483a0e9 | [
"Apache-2.0"
] | 1 | 2020-07-08T19:00:05.000Z | 2021-08-21T01:12:46.000Z | sequentiality.py | An0nYm0u5101/api_key_detector | e0ca322cda65e619479109fbcb8a7dda9483a0e9 | [
"Apache-2.0"
] | 10 | 2018-08-14T05:30:02.000Z | 2021-12-21T22:54:17.000Z | import math
import sys
import matplotlib
matplotlib.use('Agg') # Avoid tkinter dependency
import matplotlib.pyplot as plt
from . import charset as cset
def string_sequentiality(string, charset, plot_scatterplot=False):
"""
Computes how much a string contains sequence of consecutive or distance-fixed chara... | 28.495327 | 119 | 0.632666 | import math
import sys
import matplotlib
matplotlib.use('Agg') import matplotlib.pyplot as plt
from . import charset as cset
def string_sequentiality(string, charset, plot_scatterplot=False):
if len(string) <= 2:
return 0
string_length = len(string)
window_size = math.floor(math.log(string_len... | true | true |
f77a3f5d67a1ec86deaccdccf18194f15a06d620 | 15,703 | py | Python | parser.py | lostvikx/personal-website | 3451710189277944f56b9dd5a05f0eb877043723 | [
"MIT"
] | null | null | null | parser.py | lostvikx/personal-website | 3451710189277944f56b9dd5a05f0eb877043723 | [
"MIT"
] | null | null | null | parser.py | lostvikx/personal-website | 3451710189277944f56b9dd5a05f0eb877043723 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import re
import datetime
import json
import copy
# Parses the md file, outputs html string
def createArticle(mdFileName:str, isBlog=True):
"""
mdFileName: md file name
isBlog: boolean
Returns: { article, postTitle, postSubject, timeCreated }
article: the blog post in HTM... | 25.827303 | 208 | 0.588614 |
import os
import re
import datetime
import json
import copy
def createArticle(mdFileName:str, isBlog=True):
article = ""
postTitle = ""
postSubject = None
global timeCreated
timeCreated = datetime.datetime.now().strftime("%a %b %d %X %Y")
global thumbnail
thumbnail = ""
global numImgFound
numI... | true | true |
f77a3f9fff0a26966626240dfc8c2bb583432bdc | 10,470 | py | Python | src/reporter/tests/test_op.py | pooja1pathak/ngsi-timeseries-api | 1709b2f62e6c8b5112cca4badcfb01b92bcc9bb5 | [
"MIT"
] | null | null | null | src/reporter/tests/test_op.py | pooja1pathak/ngsi-timeseries-api | 1709b2f62e6c8b5112cca4badcfb01b92bcc9bb5 | [
"MIT"
] | null | null | null | src/reporter/tests/test_op.py | pooja1pathak/ngsi-timeseries-api | 1709b2f62e6c8b5112cca4badcfb01b92bcc9bb5 | [
"MIT"
] | 1 | 2022-02-13T13:05:17.000Z | 2022-02-13T13:05:17.000Z | from conftest import QL_URL
from reporter.tests.utils import insert_test_data, delete_test_data
import pytest
import requests
import json
import time
entity_type = 'Room'
entity_id = 'Room0'
temperature = 'temperature'
pressure = 'pressure'
n_days = 30
services = ['t1', 't2']
query_url = "{}/op/query".format(QL_URL)
... | 25.724816 | 77 | 0.511175 | from conftest import QL_URL
from reporter.tests.utils import insert_test_data, delete_test_data
import pytest
import requests
import json
import time
entity_type = 'Room'
entity_id = 'Room0'
temperature = 'temperature'
pressure = 'pressure'
n_days = 30
services = ['t1', 't2']
query_url = "{}/op/query".format(QL_URL)
... | true | true |
f77a4168cf23d67ce2257b1493859a5474990071 | 929 | py | Python | search_web.py | beepscore/websearcher | f8b792caf1dd835302fbb22011ee6b7a147ba210 | [
"MIT"
] | null | null | null | search_web.py | beepscore/websearcher | f8b792caf1dd835302fbb22011ee6b7a147ba210 | [
"MIT"
] | 1 | 2020-02-16T20:50:46.000Z | 2020-02-16T20:50:46.000Z | search_web.py | beepscore/websearcher | f8b792caf1dd835302fbb22011ee6b7a147ba210 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from websearcher import web_searcher_arg_reader
from websearcher import web_searcher
"""
Search for expression without instantiating an instance. Use command line arguments.
"""
# instantiate arg_reader
web_searcher_arg_reader = web_searcher_arg_reader.WebSearcherArgReader()
web_searcher_args ... | 34.407407 | 84 | 0.677072 |
from websearcher import web_searcher_arg_reader
from websearcher import web_searcher
web_searcher_arg_reader = web_searcher_arg_reader.WebSearcherArgReader()
web_searcher_args = web_searcher_arg_reader.args()
expression = web_searcher_args.expression
search_directory = web_searcher_args.search_directory
out_dir = w... | true | true |
f77a43bee4d2aaca3f9749647144c86aa335a314 | 1,407 | py | Python | integration_tests/test_double_battles.py | suminzu/poke-env | 2cb67591eb81f5ae2c62495ed56188c1e681441b | [
"MIT"
] | null | null | null | integration_tests/test_double_battles.py | suminzu/poke-env | 2cb67591eb81f5ae2c62495ed56188c1e681441b | [
"MIT"
] | 3 | 2022-03-05T14:22:08.000Z | 2022-03-29T10:36:47.000Z | integration_tests/test_double_battles.py | darrenswhite/poke-env | 1116d7ef765fdf1048083801adfa528df3f7215e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import asyncio
import pytest
from poke_env.player.random_player import RandomPlayer
from poke_env.player.utils import cross_evaluate
from poke_env.player_configuration import PlayerConfiguration
from poke_env.server_configuration import LocalhostServerConfiguration
async def simple_cross_eval... | 33.5 | 86 | 0.714996 | import asyncio
import pytest
from poke_env.player.random_player import RandomPlayer
from poke_env.player.utils import cross_evaluate
from poke_env.player_configuration import PlayerConfiguration
from poke_env.server_configuration import LocalhostServerConfiguration
async def simple_cross_evaluation(n_battles, format... | true | true |
f77a441b04b27b193c7c04ba9a72d4731cb5c54b | 772 | py | Python | scripts/get_bank_registry_cz.py | eviltnan/schwifty | 9b22c711b908b01afb0003bd41e58cacaa8006e3 | [
"MIT"
] | 92 | 2020-01-15T19:31:01.000Z | 2022-03-24T12:12:09.000Z | scripts/get_bank_registry_cz.py | eviltnan/schwifty | 9b22c711b908b01afb0003bd41e58cacaa8006e3 | [
"MIT"
] | 44 | 2020-01-13T16:49:15.000Z | 2022-03-16T15:50:08.000Z | scripts/get_bank_registry_cz.py | eviltnan/schwifty | 9b22c711b908b01afb0003bd41e58cacaa8006e3 | [
"MIT"
] | 36 | 2019-12-21T12:08:32.000Z | 2022-03-15T23:06:19.000Z | import csv
import json
import requests
URL = "https://www.cnb.cz/cs/platebni-styk/.galleries/ucty_kody_bank/download/kody_bank_CR.csv"
def process():
with requests.get(URL, stream=True) as fp:
csvfile = csv.reader([line.decode("latin1") for line in fp.iter_lines()], delimiter=";")
return [
... | 25.733333 | 96 | 0.567358 | import csv
import json
import requests
URL = "https://www.cnb.cz/cs/platebni-styk/.galleries/ucty_kody_bank/download/kody_bank_CR.csv"
def process():
with requests.get(URL, stream=True) as fp:
csvfile = csv.reader([line.decode("latin1") for line in fp.iter_lines()], delimiter=";")
return [
... | true | true |
f77a45666aa7325a3a1d56900c223d2d99b962fa | 4,599 | py | Python | generate_video_demo.py | AK391/RealBasicVSR | 41a27d90447b324296e932da7b08b7a42aa7a613 | [
"Apache-2.0"
] | 1 | 2022-03-13T12:19:54.000Z | 2022-03-13T12:19:54.000Z | generate_video_demo.py | AK391/RealBasicVSR | 41a27d90447b324296e932da7b08b7a42aa7a613 | [
"Apache-2.0"
] | null | null | null | generate_video_demo.py | AK391/RealBasicVSR | 41a27d90447b324296e932da7b08b7a42aa7a613 | [
"Apache-2.0"
] | null | null | null | import glob
import cv2
import mmcv
import numpy as np
class VideoDemo:
''' Generate video demo given two sets of images.
Please note that there will be video compression when you save the output
as a video. Therefore, the result would be inferior to the actual outputs.
Args:
input_left_dir ... | 35.929688 | 79 | 0.616003 | import glob
import cv2
import mmcv
import numpy as np
class VideoDemo:
def __init__(self, input_left_dir, input_right_dir, output_path,
start_frame, pause_frame, repeat_when_pause, slide_step,
line_width, frame_rate):
self.paths_left = sorted(glob.glob(f'{input_left_di... | true | true |
f77a465b5b28bad055d3322f4643ef7ff4fc93e6 | 13,077 | py | Python | Tensorflow/source/google/__init__.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2019-06-27T12:09:44.000Z | 2019-06-27T12:09:44.000Z | Tensorflow/source/google/__init__.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 2 | 2021-09-27T21:27:24.000Z | 2021-10-15T10:45:29.000Z | Tensorflow/source/google/__init__.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2020-10-11T14:51:22.000Z | 2020-10-11T14:51:22.000Z | #!/usr/bin/env python
# Python bindings to the Google search engine
# Copyright (c) 2009-2016, Mario Vilas
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code... | 37.362857 | 145 | 0.650684 |
__all__ = ['search', 'search_images', 'search_news', 'search_videos', 'search_shop', 'search_books', 'search_apps', 'lucky']
import os
import random
import sys
import time
if sys.version_info[0] > 2:
from http.cookiejar import LWPCookieJar
from urllib.request import Request, urlopen
from urllib.parse im... | true | true |
f77a467e8da0086c9ab196aba0099bb1807f10f8 | 363 | py | Python | tests/__init__.py | lsmo-epfl/aiida-qeq | e11d8d644a0ab9f205ded9e5ceed07820872d0bf | [
"MIT"
] | 3 | 2019-03-17T08:21:38.000Z | 2020-09-28T03:32:25.000Z | tests/__init__.py | ltalirz/aiida-qeq | e11d8d644a0ab9f205ded9e5ceed07820872d0bf | [
"MIT"
] | 8 | 2018-11-21T16:06:20.000Z | 2020-12-09T13:56:11.000Z | tests/__init__.py | ltalirz/aiida-qeq | e11d8d644a0ab9f205ded9e5ceed07820872d0bf | [
"MIT"
] | 2 | 2018-11-21T16:56:46.000Z | 2019-08-14T07:38:32.000Z | # -*- coding: utf-8 -*-
""" tests for the plugin
Use the aiida.utils.fixtures.PluginTestCase class for convenient
testing that does not pollute your profiles/databases.
"""
# Helper functions for tests
import os
import tempfile
from pathlib import Path
TEST_DIR = Path(__file__).resolve().parent
DATA_DIR = TEST_DIR ... | 20.166667 | 64 | 0.754821 |
import os
import tempfile
from pathlib import Path
TEST_DIR = Path(__file__).resolve().parent
DATA_DIR = TEST_DIR / 'data'
TEST_COMPUTER = 'localhost-test'
| true | true |
f77a472f114d5bb9912b2d6568728a9d84de6544 | 2,092 | py | Python | pachong/gupiao.py | shixingxing/tf-learn | 4fa2eee3a51328fcf12665495356d0ce05cc537a | [
"Apache-2.0"
] | null | null | null | pachong/gupiao.py | shixingxing/tf-learn | 4fa2eee3a51328fcf12665495356d0ce05cc537a | [
"Apache-2.0"
] | null | null | null | pachong/gupiao.py | shixingxing/tf-learn | 4fa2eee3a51328fcf12665495356d0ce05cc537a | [
"Apache-2.0"
] | null | null | null | import requests
import re
import pandas as pd
import _thread
# 用get方法访问服务器并提取页面数据
def getHtml(cmd, page):
url = "http://nufm.dfcfw.com/EM_Finance2014NumericApplication/JS.aspx?cb=jQuery112406115645482397511_1542356447436&type=CT&token=4f1862fc3b5e77c150a2b985b12db0fd&sty=FCOIATC&js=(%7Bdata%3A%5B(x)%5D%2CrecordsF... | 29.055556 | 283 | 0.546367 | import requests
import re
import pandas as pd
import _thread
def getHtml(cmd, page):
url = "http://nufm.dfcfw.com/EM_Finance2014NumericApplication/JS.aspx?cb=jQuery112406115645482397511_1542356447436&type=CT&token=4f1862fc3b5e77c150a2b985b12db0fd&sty=FCOIATC&js=(%7Bdata%3A%5B(x)%5D%2CrecordsFiltered%3A(tot)%7D)&c... | true | true |
f77a47a5a3b444736e3d256d5cdbf174aa6d8d35 | 506 | py | Python | 006.之字型转换字符串/答案.py | hi-weijun/pydatas-leecode | a9656fd0c61d619e4748f58a50f8f5ece675ffe7 | [
"Apache-2.0"
] | 50 | 2019-12-25T16:20:57.000Z | 2022-03-29T03:38:54.000Z | 006.之字型转换字符串/答案.py | hi-weijun/pydatas-leecode | a9656fd0c61d619e4748f58a50f8f5ece675ffe7 | [
"Apache-2.0"
] | 1 | 2020-01-20T10:27:26.000Z | 2020-01-22T10:15:42.000Z | 006.之字型转换字符串/答案.py | hi-weijun/pydatas-leecode | a9656fd0c61d619e4748f58a50f8f5ece675ffe7 | [
"Apache-2.0"
] | 14 | 2019-12-25T16:27:18.000Z | 2022-01-16T06:23:53.000Z | class Solution(object):
def convert(self, s, numRows):
"""
:s的类型: str
:numRows类型: int
:返回类型: str
"""
if numRows <= 1:
return s
n = len(s)
ans = []
step = 2 * numRows - 2
for i in range(numRows):
one = i
two = -i
while one < n or two < n:
if 0 <= ... | 22 | 60 | 0.460474 | class Solution(object):
def convert(self, s, numRows):
if numRows <= 1:
return s
n = len(s)
ans = []
step = 2 * numRows - 2
for i in range(numRows):
one = i
two = -i
while one < n or two < n:
if 0 <= two < n and one != two and i != numRows - 1:
ans.append(... | true | true |
f77a48ce9f01ba1cd8cafa8738278282986c3cd7 | 77 | py | Python | transformer.py | ViktorStagge/transformer | 39a331f41cafbfbe5fdf64ffdac5897b4d2aa319 | [
"MIT"
] | null | null | null | transformer.py | ViktorStagge/transformer | 39a331f41cafbfbe5fdf64ffdac5897b4d2aa319 | [
"MIT"
] | null | null | null | transformer.py | ViktorStagge/transformer | 39a331f41cafbfbe5fdf64ffdac5897b4d2aa319 | [
"MIT"
] | null | null | null | from transformer import cli
if __name__ == '__main__':
cli.main_group()
| 15.4 | 27 | 0.714286 | from transformer import cli
if __name__ == '__main__':
cli.main_group()
| true | true |
f77a48fb5badf61e91d0bb2be4f71a0f7b1e4c48 | 1,353 | py | Python | tests/integ/aws/test_athena.py | jucyai/red-panda | a47c81cdf42c9c9e057432106c505ea415edccba | [
"MIT"
] | 12 | 2019-06-10T08:05:51.000Z | 2022-03-08T01:24:15.000Z | tests/integ/aws/test_athena.py | jucyai/red-panda | a47c81cdf42c9c9e057432106c505ea415edccba | [
"MIT"
] | 4 | 2020-03-25T06:42:12.000Z | 2022-02-10T03:29:28.000Z | tests/integ/aws/test_athena.py | jucyai/red-panda | a47c81cdf42c9c9e057432106c505ea415edccba | [
"MIT"
] | 3 | 2021-02-18T02:40:55.000Z | 2022-03-30T17:41:21.000Z | import pytest
from red_panda.aws.athena import AthenaUtils
import logging
LOGGER = logging.getLogger(__name__)
@pytest.fixture
def athena_utils(aws_config, athena_result_location, aws_region):
return AthenaUtils(
aws_config, athena_result_location, region_name=aws_region, work_group="primary"
)
de... | 28.787234 | 88 | 0.711752 | import pytest
from red_panda.aws.athena import AthenaUtils
import logging
LOGGER = logging.getLogger(__name__)
@pytest.fixture
def athena_utils(aws_config, athena_result_location, aws_region):
return AthenaUtils(
aws_config, athena_result_location, region_name=aws_region, work_group="primary"
)
de... | true | true |
f77a49e53630e4bb8983226b286e04b2eb9ba9af | 68 | py | Python | serialize/__init__.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 4 | 2016-12-17T20:06:10.000Z | 2021-11-19T04:45:29.000Z | serialize/__init__.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 11 | 2021-01-06T05:35:11.000Z | 2022-03-11T23:28:31.000Z | serialize/__init__.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 3 | 2015-06-12T10:44:16.000Z | 2021-07-26T18:39:47.000Z | """Persistence and serialization tools"""
__author__ = 'thorwhalen'
| 22.666667 | 41 | 0.764706 | __author__ = 'thorwhalen'
| true | true |
f77a4c81c0d36d9da8149b1a508a936fabac8f79 | 2,503 | py | Python | Fibonacci Heap/dijstra_using_fib_heap.py | Nik6198/Advanced-DataStructure | c7c6154b8dd5ff94825ad91020dccd8637d73fb1 | [
"MIT"
] | null | null | null | Fibonacci Heap/dijstra_using_fib_heap.py | Nik6198/Advanced-DataStructure | c7c6154b8dd5ff94825ad91020dccd8637d73fb1 | [
"MIT"
] | null | null | null | Fibonacci Heap/dijstra_using_fib_heap.py | Nik6198/Advanced-DataStructure | c7c6154b8dd5ff94825ad91020dccd8637d73fb1 | [
"MIT"
] | null | null | null | import _fib_heap
import random
import time
import matplotlib.pyplot as plt
class graph:
def __init__(self,n):
self.graph=[]
for i in range(n):
temp=[random.randint(0,1001) for i in range(n)]
temp[i]=0
self.graph.append(temp)
def accept(self):
for i in range(len(self.gr... | 23.175926 | 72 | 0.535757 | import _fib_heap
import random
import time
import matplotlib.pyplot as plt
class graph:
def __init__(self,n):
self.graph=[]
for i in range(n):
temp=[random.randint(0,1001) for i in range(n)]
temp[i]=0
self.graph.append(temp)
def accept(self):
for i in range(len(self.gr... | true | true |
f77a4cabba529dc95ee1eda96317dea0e725af4a | 374 | py | Python | balanced_news/news/migrations/0004_alter_headline_title.py | thearyanmittal/news-aggregator | 2debf78a23a882040c88bcc1facf0087ee30fbfb | [
"Apache-2.0"
] | null | null | null | balanced_news/news/migrations/0004_alter_headline_title.py | thearyanmittal/news-aggregator | 2debf78a23a882040c88bcc1facf0087ee30fbfb | [
"Apache-2.0"
] | null | null | null | balanced_news/news/migrations/0004_alter_headline_title.py | thearyanmittal/news-aggregator | 2debf78a23a882040c88bcc1facf0087ee30fbfb | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-12 23:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0003_headline_time_ago_str'),
]
operations = [
migrations.AlterField(
model_name='headline',
name='title',
... | 19.684211 | 47 | 0.588235 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0003_headline_time_ago_str'),
]
operations = [
migrations.AlterField(
model_name='headline',
name='title',
field=models.TextField(),
),
... | true | true |
f77a4ce2e0a980042ad393b792ac987294f01391 | 6,616 | py | Python | examples/01_DataOperations/plot_adjacency.py | tomMEM/nltools | 848112e9c3f973e1c2a4b3790682ef9e5afc5b45 | [
"MIT"
] | null | null | null | examples/01_DataOperations/plot_adjacency.py | tomMEM/nltools | 848112e9c3f973e1c2a4b3790682ef9e5afc5b45 | [
"MIT"
] | null | null | null | examples/01_DataOperations/plot_adjacency.py | tomMEM/nltools | 848112e9c3f973e1c2a4b3790682ef9e5afc5b45 | [
"MIT"
] | null | null | null | """
Adjacency Class
===============
Nltools has an additional data structure class for working with two-dimensional
square matrices. This can be helpful when working with similarity/distance
matrices or directed or undirected graphs. Similar to the Brain_Data class,
matrices are vectorized and can store multiple matri... | 53.788618 | 703 | 0.646463 |
from nltools.data import Adjacency
from scipy.linalg import block_diag
import numpy as np
m1 = block_diag(np.ones((4, 4)), np.zeros((4, 4)), np.zeros((4, 4)))
m2 = block_diag(np.zeros((4, 4)), np.ones((4, 4)), np.zeros((4, 4)))
m3 = block_diag(np.zeros((4, 4)), np.zeros((4, 4)), np.ones((4, 4)))
noisy = (m1*1+m2*2+m... | true | true |
f77a4dbffe23aee36b9d3fe9a4b9ad7492a1c449 | 957 | py | Python | .history/instagram/urls_20201122022934.py | Nyash-Mauro/Instagram-clone | 39f3b660b3bdd59996fa88816712c906d0e3fba5 | [
"MIT"
] | null | null | null | .history/instagram/urls_20201122022934.py | Nyash-Mauro/Instagram-clone | 39f3b660b3bdd59996fa88816712c906d0e3fba5 | [
"MIT"
] | null | null | null | .history/instagram/urls_20201122022934.py | Nyash-Mauro/Instagram-clone | 39f3b660b3bdd59996fa88816712c906d0e3fba5 | [
"MIT"
] | null | null | null | """instagram URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 36.807692 | 77 | 0.702194 | from django.contrib import admin
from django.conf.urls import url,include
from django.contrib.auth import views
urlpatterns = [
pat('admin/', admin.site.urls),
path('',include('gram.urls')),
path('accounts/', include('registration.backends.simple.urls')),
path('logout/', views.logout,{"next_page":'/'})... | true | true |
f77a4dd1113e9112ef77f117d640464e5f47b2a2 | 13,807 | py | Python | pyscf/pbc/df/test/test_ft_ao.py | willwheelera/pyscf | 1de7f6fb8403bb0769a05eade2c2e7aa4f8a160e | [
"Apache-2.0"
] | null | null | null | pyscf/pbc/df/test/test_ft_ao.py | willwheelera/pyscf | 1de7f6fb8403bb0769a05eade2c2e7aa4f8a160e | [
"Apache-2.0"
] | null | null | null | pyscf/pbc/df/test/test_ft_ao.py | willwheelera/pyscf | 1de7f6fb8403bb0769a05eade2c2e7aa4f8a160e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 49.310714 | 103 | 0.592453 |
import unittest
import numpy
from pyscf.pbc import gto as pgto
from pyscf.pbc import dft as pdft
from pyscf.pbc.df import ft_ao
from pyscf.pbc import tools
from pyscf import lib
def setUpModule():
global cell, cell1
cell = pgto.Cell()
cell.atom = '''
He1 1.3 .2 .3
He2 .1 .1 1... | true | true |
f77a4e1104dfd316609124403d2fb779b9dc127d | 1,363 | py | Python | scrapy_lab/mtime/mtime/spiders/top100.py | ch1huizong/lab | c1622f94ca5c8a716cb5769fa6213060eb7c140d | [
"MIT"
] | null | null | null | scrapy_lab/mtime/mtime/spiders/top100.py | ch1huizong/lab | c1622f94ca5c8a716cb5769fa6213060eb7c140d | [
"MIT"
] | null | null | null | scrapy_lab/mtime/mtime/spiders/top100.py | ch1huizong/lab | c1622f94ca5c8a716cb5769fa6213060eb7c140d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from scrapy.loader import ItemLoader
from mtime.items import MtimeItem
from mtime.loaders import MtimeLoader
class Top100Spider(scrapy.Spider):
name = 'top100'
allowed_domains = ['mtime.com']
start_urls = [
'http://www.mtime.com/top/movie/top100/',
]
... | 42.59375 | 90 | 0.633162 | import scrapy
from scrapy.loader import ItemLoader
from mtime.items import MtimeItem
from mtime.loaders import MtimeLoader
class Top100Spider(scrapy.Spider):
name = 'top100'
allowed_domains = ['mtime.com']
start_urls = [
'http://www.mtime.com/top/movie/top100/',
]
def parse(self, respons... | true | true |
f77a4eb5aa14c71aa4b2d7a6f3ffcba2d963dfcd | 1,694 | py | Python | bdgtools/splitregions.py | knutdrand/bdgtools | 18d21586515ec03e5fb96e959447f6b35e5350de | [
"MIT"
] | null | null | null | bdgtools/splitregions.py | knutdrand/bdgtools | 18d21586515ec03e5fb96e959447f6b35e5350de | [
"MIT"
] | null | null | null | bdgtools/splitregions.py | knutdrand/bdgtools | 18d21586515ec03e5fb96e959447f6b35e5350de | [
"MIT"
] | null | null | null | import numpy as np
from .regions import Regions
class SplitRegions:
def __init__(self, regions, offsets):
self._regions = regions
self._offsets = offsets
def get_signals(self, bedgraph):
signals = bedgraph.extract_regions(self._regions)
return signals.join_rows(self._offsets)
... | 36.826087 | 163 | 0.637544 | import numpy as np
from .regions import Regions
class SplitRegions:
def __init__(self, regions, offsets):
self._regions = regions
self._offsets = offsets
def get_signals(self, bedgraph):
signals = bedgraph.extract_regions(self._regions)
return signals.join_rows(self._offsets)
... | true | true |
f77a4f22017e803e2b04caf9b84c3991a675cd60 | 12,249 | py | Python | samples/FacetExample.py | rudimeier/pylucene | 4cc2dd57170c27085f3ff8ad22e179f977097f3e | [
"Apache-2.0"
] | 5 | 2017-03-17T04:35:39.000Z | 2021-04-06T07:20:04.000Z | samples/FacetExample.py | rudimeier/pylucene | 4cc2dd57170c27085f3ff8ad22e179f977097f3e | [
"Apache-2.0"
] | null | null | null | samples/FacetExample.py | rudimeier/pylucene | 4cc2dd57170c27085f3ff8ad22e179f977097f3e | [
"Apache-2.0"
] | 1 | 2018-02-19T13:17:14.000Z | 2018-02-19T13:17:14.000Z | # ====================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 39.640777 | 99 | 0.602008 |
usage = """
usage: python FacetExample.py [index | simple | drilldown]
where
'index' => create index for faceted search
'simple' => run simple faceted search
'drilldown' => run faceted search with drilldown
"""
INDEX_DIR = "FacetExample.Index"
TAXONOMY_DIR = "FacetExample.Taxonomy"
import os, sys, l... | true | true |
f77a4fdc389f628e4ab7437d990430ac7faab585 | 3,363 | py | Python | test_tensorboard.py | wishprophet/TensorFlow | aacb173a65fe9e392c1a72309aff58ed02f5c32d | [
"MIT"
] | null | null | null | test_tensorboard.py | wishprophet/TensorFlow | aacb173a65fe9e392c1a72309aff58ed02f5c32d | [
"MIT"
] | null | null | null | test_tensorboard.py | wishprophet/TensorFlow | aacb173a65fe9e392c1a72309aff58ed02f5c32d | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
@version: ??
@author: Mouse
@license: Apache Licence
@contact: admin@lovexing.cn
@software: PyCharm
@file: tensorboard.py
@time: 2018/5/10 9:36
"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def main():
# 载入数据
mnist = input_data.read_data_sets('M... | 35.776596 | 121 | 0.630092 |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def main():
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
batch_size = 50
n_batch = mnist.train.num_examples // batch_size
with tf.name_scope('input'):
x = tf.placeholder(t... | true | true |
f77a51d9d2d3841d56cb96cae4468d2d8aeebee5 | 5,679 | py | Python | olfactory/tests/test_preprocessing.py | OctaveLauby/olfactory | 679b67459c12002041a8f77e1bdffe33d776500b | [
"Apache-2.0"
] | null | null | null | olfactory/tests/test_preprocessing.py | OctaveLauby/olfactory | 679b67459c12002041a8f77e1bdffe33d776500b | [
"Apache-2.0"
] | null | null | null | olfactory/tests/test_preprocessing.py | OctaveLauby/olfactory | 679b67459c12002041a8f77e1bdffe33d776500b | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pytest
from olfactory import preprocessing
def test_pipe_filter():
class Elem(dict):
def __init__(self, dic):
super().__init__(dic)
self.id = dic['id']
self.flags = set()
def __getattr__(self, attribute):
try:
... | 29.42487 | 86 | 0.525973 | import numpy as np
import pytest
from olfactory import preprocessing
def test_pipe_filter():
class Elem(dict):
def __init__(self, dic):
super().__init__(dic)
self.id = dic['id']
self.flags = set()
def __getattr__(self, attribute):
try:
... | true | true |
f77a52f69f11c298eea36d52c078dfc73f1c7c4e | 389 | py | Python | Day 2/Solution1.py | joll05/AdventOfCode2020 | d2d93395cec72095d749a07743b70e7fd6f41297 | [
"MIT"
] | null | null | null | Day 2/Solution1.py | joll05/AdventOfCode2020 | d2d93395cec72095d749a07743b70e7fd6f41297 | [
"MIT"
] | null | null | null | Day 2/Solution1.py | joll05/AdventOfCode2020 | d2d93395cec72095d749a07743b70e7fd6f41297 | [
"MIT"
] | null | null | null | import re
f=open("input.txt")
Input = f.read().split("\n")
f.close()
regex = r"(.+)-(.+) (.): (.+)"
count = 0
for i in Input:
match = re.match(regex, i)
minOccurrence = int(match.group(1))
maxOccurrence = int(match.group(2))
char = match.group(3)
if(minOccurrence <= match.group(4)... | 19.45 | 70 | 0.557841 | import re
f=open("input.txt")
Input = f.read().split("\n")
f.close()
regex = r"(.+)-(.+) (.): (.+)"
count = 0
for i in Input:
match = re.match(regex, i)
minOccurrence = int(match.group(1))
maxOccurrence = int(match.group(2))
char = match.group(3)
if(minOccurrence <= match.group(4)... | true | true |
f77a53166ba47061313f7a0b69438cf4680d44e4 | 10,281 | py | Python | aries_cloudagent/protocols/present_proof/v2_0/models/pres_exchange.py | itaru2622/aries-cloudagent-python | db6b7699e603ecb335165a79459fbab7b6587a70 | [
"Apache-2.0"
] | 4 | 2019-07-01T13:12:50.000Z | 2019-07-02T20:01:37.000Z | aries_cloudagent/protocols/present_proof/v2_0/models/pres_exchange.py | itaru2622/aries-cloudagent-python | db6b7699e603ecb335165a79459fbab7b6587a70 | [
"Apache-2.0"
] | 29 | 2019-06-24T22:48:04.000Z | 2019-07-02T20:52:16.000Z | aries_cloudagent/protocols/present_proof/v2_0/models/pres_exchange.py | amanji/aries-cloudagent-python | 211af2b4e5b8131d64b1b3855ef8e352e831b71f | [
"Apache-2.0"
] | 12 | 2019-06-24T22:17:44.000Z | 2019-07-02T19:49:31.000Z | """Presentation exchange record."""
import logging
from typing import Any, Mapping, Union
from marshmallow import fields, Schema, validate
from .....core.profile import ProfileSession
from .....messaging.models.base_record import BaseExchangeRecord, BaseExchangeSchema
from .....messaging.valid import UUIDFour
from ... | 32.028037 | 88 | 0.58613 |
import logging
from typing import Any, Mapping, Union
from marshmallow import fields, Schema, validate
from .....core.profile import ProfileSession
from .....messaging.models.base_record import BaseExchangeRecord, BaseExchangeSchema
from .....messaging.valid import UUIDFour
from .....storage.base import StorageErro... | true | true |
f77a5529ec1684faa08853d4928d26efdbbdaeb1 | 1,069 | py | Python | src/spacel/aws/ami.py | mycloudandme/spacel-provision | 900b8ada0017f727163c5c2ae464e17d747ba0e8 | [
"MIT"
] | 2 | 2016-05-18T11:10:27.000Z | 2016-05-18T13:25:04.000Z | src/spacel/aws/ami.py | mycloudandme/spacel-provision | 900b8ada0017f727163c5c2ae464e17d747ba0e8 | [
"MIT"
] | null | null | null | src/spacel/aws/ami.py | mycloudandme/spacel-provision | 900b8ada0017f727163c5c2ae464e17d747ba0e8 | [
"MIT"
] | null | null | null | import json
import logging
import time
from six.moves.urllib.request import urlopen
SPACEL_URL = 'https://ami.pbl.io/spacel/%s.json'
logger = logging.getLogger('spacel.aws.ami')
class AmiFinder(object):
def __init__(self, channel=None, cache_bust=None):
self._channel = channel or 'stable'
self.... | 28.891892 | 72 | 0.606174 | import json
import logging
import time
from six.moves.urllib.request import urlopen
SPACEL_URL = 'https://ami.pbl.io/spacel/%s.json'
logger = logging.getLogger('spacel.aws.ami')
class AmiFinder(object):
def __init__(self, channel=None, cache_bust=None):
self._channel = channel or 'stable'
self.... | true | true |
f77a555d21f0c06e4b18eea8c05e94627a4a5971 | 3,605 | py | Python | scripts/pythonutils/funcparser.py | shulinye/dotfiles | a342512c33ca102d03921cc653ee4605d0cf9617 | [
"MIT"
] | 2 | 2015-01-16T22:07:10.000Z | 2015-11-09T06:45:44.000Z | scripts/pythonutils/funcparser.py | shulinye/dotfiles | a342512c33ca102d03921cc653ee4605d0cf9617 | [
"MIT"
] | 4 | 2015-07-08T19:13:47.000Z | 2015-08-31T16:04:36.000Z | scripts/pythonutils/funcparser.py | shulinye/dotfiles | a342512c33ca102d03921cc653ee4605d0cf9617 | [
"MIT"
] | null | null | null | #/usr/bin/env python3
import argparse
import inspect
import __main__
__all__ = ['FuncParser']
def nonempty(item):
return item if item != inspect._empty else None
class FuncParser(argparse.ArgumentParser):
def __init__(self, *args, funclist=None, description=None, **kwargs):
if description is None:
... | 45.632911 | 128 | 0.579196 |
import argparse
import inspect
import __main__
__all__ = ['FuncParser']
def nonempty(item):
return item if item != inspect._empty else None
class FuncParser(argparse.ArgumentParser):
def __init__(self, *args, funclist=None, description=None, **kwargs):
if description is None:
description... | true | true |
f77a561351c806b22ba30838da17165d65e714f6 | 1,171 | py | Python | FLASH4.2.1_save/lib/sqrt3/libinfo.py | mtsafarzadeh/FLASHverES | 4c644e63efa7ee49e35293acb72dd2ea75da77f4 | [
"Apache-2.0"
] | 1 | 2021-04-22T09:24:08.000Z | 2021-04-22T09:24:08.000Z | FLASH4.2.1_save/lib/sqrt3/libinfo.py | mtsafarzadeh/FLASHverES | 4c644e63efa7ee49e35293acb72dd2ea75da77f4 | [
"Apache-2.0"
] | null | null | null | FLASH4.2.1_save/lib/sqrt3/libinfo.py | mtsafarzadeh/FLASHverES | 4c644e63efa7ee49e35293acb72dd2ea75da77f4 | [
"Apache-2.0"
] | null | null | null | import re, os, sys
#Create an executable build script which builds the library
#given by the "lib" argument.
def create_build_script(absLibDir,lib,buildFlag):
buildScript = absLibDir + '/build.csh'
if os.path.isfile(buildScript):
os.remove(buildScript)
fileObj = open(buildScript, 'w')
fileOb... | 30.025641 | 70 | 0.6345 | import re, os, sys
def create_build_script(absLibDir,lib,buildFlag):
buildScript = absLibDir + '/build.csh'
if os.path.isfile(buildScript):
os.remove(buildScript)
fileObj = open(buildScript, 'w')
fileObj.write('#!/bin/csh\n')
fileObj.write('# Dont forget to make this file executable!\n\... | false | true |
f77a5745d60bfef83485a827a3bb9f30b27b4d48 | 2,468 | py | Python | visualize_layers.py | amsimoes/bat-country | c0d29a0b32c196ca3d4c40fbaf960432b507e8bb | [
"MIT"
] | 1 | 2015-08-23T18:51:21.000Z | 2015-08-23T18:51:21.000Z | visualize_layers.py | amsimoes/bat-country | c0d29a0b32c196ca3d4c40fbaf960432b507e8bb | [
"MIT"
] | null | null | null | visualize_layers.py | amsimoes/bat-country | c0d29a0b32c196ca3d4c40fbaf960432b507e8bb | [
"MIT"
] | null | null | null | # import the necessary packages
from __future__ import print_function
from batcountry import BatCountry
from PIL import Image
import numpy as np
import argparse
import warnings
import cv2
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-b", "--base-model", requi... | 44.872727 | 147 | 0.712723 | from __future__ import print_function
from batcountry import BatCountry
from PIL import Image
import numpy as np
import argparse
import warnings
import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-b", "--base-model", required=True, help = "base model path")
ap.add_argument("-p", "--proto", required=False, hel... | false | true |
f77a5852480a6f692734868638882e1fa1df5aae | 1,600 | py | Python | profiles_api/models.py | ankit-cashify/profiles-rest-api | 0db28d3a311f90d75b92803061159ca1045fb5e5 | [
"MIT"
] | null | null | null | profiles_api/models.py | ankit-cashify/profiles-rest-api | 0db28d3a311f90d75b92803061159ca1045fb5e5 | [
"MIT"
] | null | null | null | profiles_api/models.py | ankit-cashify/profiles-rest-api | 0db28d3a311f90d75b92803061159ca1045fb5e5 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
class UserProfilesManager(BaseUserManager):
""" Manager for user creation """
def create_user(self, email, name, password=None):
""" Create new... | 28.070175 | 72 | 0.664375 | from django.db import models
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
class UserProfilesManager(BaseUserManager):
def create_user(self, email, name, password=None):
if not email:
raise ValueError("user mus... | true | true |
f77a58bd400c8f744a4ad37fd8b27c9da6389aeb | 2,527 | py | Python | wizard/core/events.py | Wizard-collab/wizard_2 | a2cb23362e178a0205f6dd0b9b4328c329b5b142 | [
"MIT"
] | 1 | 2021-10-13T15:07:32.000Z | 2021-10-13T15:07:32.000Z | wizard/core/events.py | Wizard-collab/wizard_2 | a2cb23362e178a0205f6dd0b9b4328c329b5b142 | [
"MIT"
] | null | null | null | wizard/core/events.py | Wizard-collab/wizard_2 | a2cb23362e178a0205f6dd0b9b4328c329b5b142 | [
"MIT"
] | null | null | null | # coding: utf-8
# Author: Leo BRUNEL
# Contact: contact@leobrunel.com
# This file is part of Wizard
# MIT License
# Copyright (c) 2021 Leo brunel
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the So... | 38.876923 | 127 | 0.778789 |
import logging
from wizard.core import environment
from wizard.core import project
from wizard.core import assets
logger = logging.getLogger(__name__)
def add_creation_event(instance_type, instance_id):
data = (instance_type, instance_id)
title = f"Created {assets.instance_to_string((instance_type, instanc... | true | true |
f77a59960edda367a3e28c63b062276b47a777df | 1,397 | py | Python | app.py | dishantrathi/Crypto-Currency-Live-Rates | d6c87db6c009e8a613374297168ccad3a0625f1a | [
"MIT"
] | 7 | 2017-12-18T17:46:12.000Z | 2020-10-17T02:43:18.000Z | app.py | dishantrathi/Crypto-Currency-Live-Exchange-Rates | d6c87db6c009e8a613374297168ccad3a0625f1a | [
"MIT"
] | null | null | null | app.py | dishantrathi/Crypto-Currency-Live-Exchange-Rates | d6c87db6c009e8a613374297168ccad3a0625f1a | [
"MIT"
] | null | null | null | __author__ = 'dishantrathi'
from SICCipy.SICCipy import CheckConnection
from CurrencySelection.CurrencySelection import CurrencySelection
from Help.Help import Help
from Credits.Credits import Credits ... | 34.925 | 170 | 0.590551 | __author__ = 'dishantrathi'
from SICCipy.SICCipy import CheckConnection
from CurrencySelection.CurrencySelection import CurrencySelection
from Help.Help import Help
from Credits.Credits import Credits ... | true | true |
f77a5997e008e0a47bd58017bc229ba37cdb0cba | 2,984 | py | Python | lib/surface/iam/service_accounts/sign_jwt.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/iam/service_accounts/sign_jwt.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/surface/iam/service_accounts/sign_jwt.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 34.697674 | 109 | 0.697051 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import textwrap
from googlecloudsdk.api_lib.iam import util
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.iam import iam_util
from googlecloudsdk.core import log
from googlecloud... | true | true |
f77a5af571026d323a101a5111c0f7636fa6c9a2 | 10,824 | py | Python | tools/accuracy_checker/openvino/tools/accuracy_checker/annotation_converters/kaldi_speech_recognition_pipeline.py | Ohtani-y/open_model_zoo | 280b59fc6c00455889a1949c795558252fdad96f | [
"Apache-2.0"
] | 2 | 2019-08-20T15:30:19.000Z | 2020-09-01T15:16:33.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/annotation_converters/kaldi_speech_recognition_pipeline.py | Ohtani-y/open_model_zoo | 280b59fc6c00455889a1949c795558252fdad96f | [
"Apache-2.0"
] | 4 | 2020-05-22T17:30:43.000Z | 2021-08-02T07:33:16.000Z | tools/accuracy_checker/openvino/tools/accuracy_checker/annotation_converters/kaldi_speech_recognition_pipeline.py | Ohtani-y/open_model_zoo | 280b59fc6c00455889a1949c795558252fdad96f | [
"Apache-2.0"
] | 2 | 2021-06-25T06:18:58.000Z | 2021-08-04T10:05:32.000Z | """
Copyright (c) 2018-2021 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... | 47.893805 | 119 | 0.625831 | import numpy as np
from ..data_readers import KaldiMatrixIdentifier, KaldiARKReader, KaldiFrameIdentifier
from ..representation import CharacterRecognitionAnnotation, RegressionAnnotation
from ..config import PathField, BoolField, StringField
from ..utils import read_txt
from .format_converter import BaseFormatConverte... | true | true |
f77a5c8ebff5db962b519ea64464a09c71dc7bbd | 5,399 | py | Python | backend/webInterface/tr_run.py | sixu007/TrWebOCR | b6912c02052b0ec1a1d901a9c37cd86f4d0ef5d0 | [
"Apache-2.0"
] | 1 | 2020-05-15T03:41:45.000Z | 2020-05-15T03:41:45.000Z | backend/webInterface/tr_run.py | sixu007/TrWebOCR | b6912c02052b0ec1a1d901a9c37cd86f4d0ef5d0 | [
"Apache-2.0"
] | null | null | null | backend/webInterface/tr_run.py | sixu007/TrWebOCR | b6912c02052b0ec1a1d901a9c37cd86f4d0ef5d0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# author:alisen
# time: 2020/4/29 10:47
# import json
import time
import tr
import tornado.web
import tornado.gen
import tornado.httpserver
import base64
from PIL import Image, ImageDraw
from io import BytesIO
import datetime
import logging
from logging.handlers import Rotating... | 32.329341 | 112 | 0.564364 | import time
import tr
import tornado.web
import tornado.gen
import tornado.httpserver
import base64
from PIL import Image, ImageDraw
from io import BytesIO
import datetime
import logging
from logging.handlers import RotatingFileHandler
import json
from backend.tools.np_encoder import NpEncoder
import os
BASE_PATH =... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.