hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f721134f2cf6dd7f8af453cc2143cd6f38f7cc03 | 1,204 | py | Python | lagom/envs/record_episode_statistics.py | zuoxingdong/lagom | 3b6710804dbc79c6dffb369ac87c68f4055ab6cd | [
"MIT"
] | 383 | 2018-07-11T17:43:10.000Z | 2022-01-24T08:46:23.000Z | lagom/envs/record_episode_statistics.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 90 | 2018-07-11T23:51:45.000Z | 2021-12-16T08:56:42.000Z | lagom/envs/record_episode_statistics.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 32 | 2018-07-12T18:21:03.000Z | 2021-09-15T05:47:48.000Z | import time
from collections import deque
import gym
class RecordEpisodeStatistics(gym.Wrapper):
def __init__(self, env, deque_size=100):
super().__init__(env)
self.t0 = time.perf_counter()
self.episode_return = 0.0
self.episode_horizon = 0
self.return_queue = deque(maxlen... | 34.4 | 79 | 0.599668 | import time
from collections import deque
import gym
class RecordEpisodeStatistics(gym.Wrapper):
def __init__(self, env, deque_size=100):
super().__init__(env)
self.t0 = time.perf_counter()
self.episode_return = 0.0
self.episode_horizon = 0
self.return_queue = deque(maxlen... | true | true |
f721149609f8936e76f673d4273205ed140bf7b3 | 1,608 | py | Python | blog_auth/migrations/0001_initial.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 5 | 2019-08-12T17:56:25.000Z | 2021-08-31T04:36:42.000Z | blog_auth/migrations/0001_initial.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 12 | 2020-02-12T00:38:11.000Z | 2022-03-11T23:50:12.000Z | blog_auth/migrations/0001_initial.py | MicroPyramid/ngo-cms | 5f0baf69ce646ab6b895d3ae2f49b782630c9959 | [
"MIT"
] | 8 | 2019-06-19T18:54:02.000Z | 2021-01-05T19:31:30.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('... | 43.459459 | 158 | 0.584577 |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(v... | true | true |
f721152db9db3827adab40e0750d01f58df5decf | 15,018 | py | Python | cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2015-04-02T21:44:36.000Z | 2016-04-29T21:19:04.000Z | cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2016-04-29T21:45:26.000Z | 2016-05-04T19:41:23.000Z | cinder/tests/unit/zonemanager/test_brcd_fc_zone_client_cli.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 4 | 2016-01-27T00:25:52.000Z | 2021-03-25T19:54:08.000Z | # (c) Copyright 2016 Brocade Communications Systems Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | 48.289389 | 78 | 0.699827 |
from unittest import mock
from oslo_concurrency import processutils
from cinder import exception
from cinder import test
from cinder.zonemanager.drivers.brocade import (brcd_fc_zone_client_cli
as client_cli)
from cinder.zonemanager.drivers.brocade impor... | true | true |
f72115d189ce1aea3fd459147ab92b50d1a8393a | 807 | py | Python | bluebottle/bluebottle_drf2/renderers.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/bluebottle_drf2/renderers.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/bluebottle_drf2/renderers.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | from rest_framework_json_api.renderers import JSONRenderer
from django.contrib.auth.models import AnonymousUser
class BluebottleJSONAPIRenderer(JSONRenderer):
def get_indent(self, *args, **kwargs):
return 4
@classmethod
def build_json_resource_obj(
cls,
fields,
resource,
... | 26.032258 | 79 | 0.570012 | from rest_framework_json_api.renderers import JSONRenderer
from django.contrib.auth.models import AnonymousUser
class BluebottleJSONAPIRenderer(JSONRenderer):
def get_indent(self, *args, **kwargs):
return 4
@classmethod
def build_json_resource_obj(
cls,
fields,
resource,
... | true | true |
f72116597d007b731f68d9cb1a6c637348e7d55b | 4,912 | py | Python | rclpy/rclpy/context.py | bastinat0r/rclpy | 510b243b2efe9e6b4b20837b7dea8092069cd2d3 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:28:59.000Z | 2021-01-11T06:28:59.000Z | rclpy/rclpy/context.py | bastinat0r/rclpy | 510b243b2efe9e6b4b20837b7dea8092069cd2d3 | [
"Apache-2.0"
] | 1 | 2020-06-28T10:40:59.000Z | 2020-06-28T10:40:59.000Z | rclpy/rclpy/context.py | bastinat0r/rclpy | 510b243b2efe9e6b4b20837b7dea8092069cd2d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 39.296 | 97 | 0.667142 |
import sys
import threading
from typing import Callable
from typing import List
from typing import Optional
import weakref
g_logging_configure_lock = threading.Lock()
g_logging_ref_count = 0
class Context:
def __init__(self):
from rclpy.impl.implementation_singleton import rclpy_implement... | true | true |
f72116774894f97836e29f765583285f9e3b5acf | 2,226 | py | Python | .modules/.Infoga/lib/output.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.Infoga/lib/output.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 29 | 2019-04-03T14:52:38.000Z | 2022-03-24T12:33:05.000Z | .modules/.Infoga/lib/output.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 161 | 2018-04-20T15:57:12.000Z | 2022-03-15T19:16:16.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# @name : Infoga - Email Information Gathering
# @url : http://github.com/m4ll0k
# @author : Momo Outaadi (m4ll0k)
from lib.colors import *
def plus(string):print("%s[+]%s %s"%(G%0,E,string))
def warn(string):print("%s[!]%s %s"%(R%0,E,string))
def test(string):pri... | 42.807692 | 120 | 0.600629 |
from lib.colors import *
def plus(string):print("%s[+]%s %s"%(G%0,E,string))
def warn(string):print("%s[!]%s %s"%(R%0,E,string))
def test(string):print("%s[*]%s %s"%(B%0,E,string))
def info(string):print("%s[i]%s %s"%(Y%0,E,string))
def more(string):print(" %s|%s %s"%(W%0,E,string))
def ppwned(data,ver):
if ... | true | true |
f7211689b5c3abfbb49932d88e4323e9e99aec1e | 19,600 | py | Python | pypureclient/flasharray/FA_2_3/models/volume_performance_by_array.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_3/models/volume_performance_by_array.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_3/models/volume_performance_by_array.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 55.211268 | 228 | 0.659847 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_3 import models
class VolumePerformanceByArray(object):
swagger_types = {
'id': 'str',
'name': 'str',
'bytes_per_mirrored_write': 'int',
... | true | true |
f72116c79003469c2b0e2b7eb8a18e69c2918151 | 3,600 | py | Python | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py | ikben/aws-deployment-framework | 9a32492209d35660b9ece66211eb200b64dc0ef9 | [
"Apache-2.0"
] | 1 | 2022-03-24T10:43:53.000Z | 2022-03-24T10:43:53.000Z | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py | thomasmcgannon/aws-deployment-framework | 0723ddf4eaf55888ae780dc48873f0ec4766cfbd | [
"Apache-2.0"
] | null | null | null | src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py | thomasmcgannon/aws-deployment-framework | 0723ddf4eaf55888ae780dc48873f0ec4766cfbd | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Step Functions module used throughout the ADF
"""
import json
from time import sleep
from logger import configure_logger
from partition import get_partition
LOGGER = configure_logger(__name__)
class StepF... | 31.578947 | 85 | 0.621944 |
import json
from time import sleep
from logger import configure_logger
from partition import get_partition
LOGGER = configure_logger(__name__)
class StepFunctions:
def __init__(
self,
role,
deployment_account_id,
deployment_account_region,
regions,... | true | true |
f721174bebba042d3b37612296998e084c86fde8 | 918 | py | Python | apps/cli/utils/merge_yaml_sources.py | derekmerck/DIANA | 5553265b8fc822b35848d0966b25b93b99d503fb | [
"MIT"
] | 9 | 2018-03-15T19:10:27.000Z | 2021-03-15T21:01:24.000Z | apps/cli/utils/merge_yaml_sources.py | derekmerck/DIANA | 5553265b8fc822b35848d0966b25b93b99d503fb | [
"MIT"
] | null | null | null | apps/cli/utils/merge_yaml_sources.py | derekmerck/DIANA | 5553265b8fc822b35848d0966b25b93b99d503fb | [
"MIT"
] | 2 | 2018-03-15T19:13:22.000Z | 2018-04-18T16:33:33.000Z | import os, logging
from glob import glob
from pprint import pformat
import yaml
"""
Env var expansion and merge data from:
- input in yaml/json format
- input file or dir of files in yaml/json format
"""
def merge_yaml_sources(data=None, path=None):
result = {}
if data:
data_exp = os.path.expandvars(d... | 27 | 57 | 0.615468 | import os, logging
from glob import glob
from pprint import pformat
import yaml
def merge_yaml_sources(data=None, path=None):
result = {}
if data:
data_exp = os.path.expandvars(data)
result = yaml.safe_load(data_exp)
if os.path.isfile(path):
with open(path) as f:
finpu... | true | true |
f7211765b08d783a5f129616815fe2035703ff38 | 25,215 | py | Python | neutron/agent/l3/router_info.py | markmcclain/neutron | 3108d2dece0501dbb661e2f5a4bb530a199f9fde | [
"Apache-2.0"
] | 3 | 2016-08-07T01:25:54.000Z | 2021-03-01T10:19:14.000Z | neutron/agent/l3/router_info.py | cyysu/neutron_read | 07d1a526d7d44ad0207d27e0ee04f1582541ab89 | [
"Apache-2.0"
] | null | null | null | neutron/agent/l3/router_info.py | cyysu/neutron_read | 07d1a526d7d44ad0207d27e0ee04f1582541ab89 | [
"Apache-2.0"
] | 2 | 2016-09-10T13:21:10.000Z | 2016-12-23T01:44:53.000Z | # Copyright (c) 2014 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 ... | 42.592905 | 79 | 0.599683 |
import netaddr
from oslo_log import log as logging
from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib
from neutron.agent.linux import iptables_manager
from neutron.agent.linux import ra
from neutron.common import constants as l3_constants
from neutron.common import exceptions... | true | true |
f72117735968d8ce8ce83ea74bae1b18b3eb310b | 284 | py | Python | app/user/urls.py | redoCehT/recipe-app-api | c529f641adf1a7d5af39bf9dc832b68af3348176 | [
"MIT"
] | null | null | null | app/user/urls.py | redoCehT/recipe-app-api | c529f641adf1a7d5af39bf9dc832b68af3348176 | [
"MIT"
] | null | null | null | app/user/urls.py | redoCehT/recipe-app-api | c529f641adf1a7d5af39bf9dc832b68af3348176 | [
"MIT"
] | null | null | null | from django.urls import path
from user import views
app_name = "user"
urlpatterns = [
path("create", views.CreateUserView.as_view(), name="create"),
path("token", views.CreateTokenView.as_view(), name="token"),
path("me", views.ManageUserView.as_view(), name="me"),
]
| 21.846154 | 66 | 0.68662 | from django.urls import path
from user import views
app_name = "user"
urlpatterns = [
path("create", views.CreateUserView.as_view(), name="create"),
path("token", views.CreateTokenView.as_view(), name="token"),
path("me", views.ManageUserView.as_view(), name="me"),
]
| true | true |
f721193ca67842d2930d048034dca9a2d38b368b | 7,370 | py | Python | elodie/media/media.py | phifogg/elodie | 6ca24c10b2b3fa28169976e04a9fd2f524250a44 | [
"Apache-2.0"
] | null | null | null | elodie/media/media.py | phifogg/elodie | 6ca24c10b2b3fa28169976e04a9fd2f524250a44 | [
"Apache-2.0"
] | 1 | 2017-01-07T06:30:43.000Z | 2017-01-19T12:47:07.000Z | elodie/media/media.py | phifogg/elodie | 6ca24c10b2b3fa28169976e04a9fd2f524250a44 | [
"Apache-2.0"
] | null | null | null | """
The media module provides a base :class:`Media` class for media objects that
are tracked by Elodie. The Media class provides some base functionality used
by all the media types, but isn't itself used to represent anything. Its
sub-classes (:class:`~elodie.media.audio.Audio`,
:class:`~elodie.media.photo.Photo`, and ... | 30.081633 | 88 | 0.589281 | from __future__ import print_function
from elodie import constants
from elodie.dependencies import get_exiftool
from elodie.external.pyexiftool import ExifTool
from elodie.media.base import Base
class Media(Base):
__name__ = 'Media'
d_coordinates = {
'latitude': 'latitude_ref',
'longitude... | true | true |
f72119fc9448d568049ba81365d0643f5fc6eaa0 | 7,330 | py | Python | src/satlas2/models/hfsModel.py | woutergins/satlas2 | 51afdc445c8c603372bb26abe19d1eb7bd3f3f24 | [
"MIT"
] | null | null | null | src/satlas2/models/hfsModel.py | woutergins/satlas2 | 51afdc445c8c603372bb26abe19d1eb7bd3f3f24 | [
"MIT"
] | null | null | null | src/satlas2/models/hfsModel.py | woutergins/satlas2 | 51afdc445c8c603372bb26abe19d1eb7bd3f3f24 | [
"MIT"
] | null | null | null | from satlas2.core import Model, Parameter
import numpy as np
from scipy.special import wofz
from sympy.physics.wigner import wigner_6j, wigner_3j
__all__ = ['HFS']
sqrt2 = 2 ** 0.5
sqrt2log2t2 = 2 * np.sqrt(2 * np.log(2))
log2 = np.log(2)
class HFS(Model):
def __init__(self, I, J, A=[0, 0], B=[0, 0], C=[0, 0], ... | 38.783069 | 206 | 0.502456 | from satlas2.core import Model, Parameter
import numpy as np
from scipy.special import wofz
from sympy.physics.wigner import wigner_6j, wigner_3j
__all__ = ['HFS']
sqrt2 = 2 ** 0.5
sqrt2log2t2 = 2 * np.sqrt(2 * np.log(2))
log2 = np.log(2)
class HFS(Model):
def __init__(self, I, J, A=[0, 0], B=[0, 0], C=[0, 0], ... | true | true |
f7211a6c4ae21fd092ed3210d9ed20271e7afe65 | 19,979 | py | Python | collect/TwHistory.py | mcuiteallen/stock | 06c56db6c712ab88fabdc67a8812869ad4180f6f | [
"MIT"
] | null | null | null | collect/TwHistory.py | mcuiteallen/stock | 06c56db6c712ab88fabdc67a8812869ad4180f6f | [
"MIT"
] | null | null | null | collect/TwHistory.py | mcuiteallen/stock | 06c56db6c712ab88fabdc67a8812869ad4180f6f | [
"MIT"
] | null | null | null | import calendar
import math
import pandas as pd
import time
import twstock
import requests
from datetime import datetime, timedelta
from dateutil import relativedelta
from db.Connection import session
from enum import Enum
from model.StockHistory import StockHistory
from sys import float_info
from talib import abstract... | 51.359897 | 207 | 0.569198 | import calendar
import math
import pandas as pd
import time
import twstock
import requests
from datetime import datetime, timedelta
from dateutil import relativedelta
from db.Connection import session
from enum import Enum
from model.StockHistory import StockHistory
from sys import float_info
from talib import abstract... | true | true |
f7211ab5f9fd402c221ac94f5f39ef29a6d25331 | 88,960 | py | Python | pandas/tests/arithmetic/test_datetime64.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | 6 | 2020-09-10T15:03:25.000Z | 2021-04-01T22:48:33.000Z | pandas/tests/arithmetic/test_datetime64.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/arithmetic/test_datetime64.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | 4 | 2020-02-07T05:05:32.000Z | 2020-05-11T06:06:17.000Z | # Arithmetic tests for DataFrame/Series/Index/Array classes that should
# behave identically.
# Specifically for datetime64 and datetime64tz dtypes
from datetime import datetime, timedelta
from itertools import product, starmap
import operator
import warnings
import numpy as np
import pytest
import pytz
from pandas._... | 36.473965 | 88 | 0.584364 |
from datetime import datetime, timedelta
from itertools import product, starmap
import operator
import warnings
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs.conversion import localize_pydatetime
from pandas._libs.tslibs.offsets import shift_months
from pandas.compat.numpy import np_datetim... | true | true |
f7211b62c471429cc135fe0e8292971b94db291e | 1,167 | py | Python | app/database/api/models/resource.py | space-logistics-org/spacenet | fd004437ed7b27dd6dc41a374e1dedfcea92e37d | [
"MIT"
] | 1 | 2022-02-17T18:01:41.000Z | 2022-02-17T18:01:41.000Z | app/database/api/models/resource.py | space-logistics-org/spacenet | fd004437ed7b27dd6dc41a374e1dedfcea92e37d | [
"MIT"
] | 2 | 2021-06-19T19:41:15.000Z | 2021-07-21T17:07:48.000Z | app/database/api/models/resource.py | space-logistics-org/spacenet | fd004437ed7b27dd6dc41a374e1dedfcea92e37d | [
"MIT"
] | 3 | 2021-06-16T16:31:12.000Z | 2022-02-17T18:02:57.000Z | """
This module defines the database schema for resources and resource subclasses.
"""
from sqlalchemy import Column, Integer, String, Float
from ..database import Base
from spacenet.schemas.resource import ResourceType
__all__ = ["Resource", "ResourceType", "ContinuousResource", "DiscreteResource"]
class Resourc... | 25.369565 | 82 | 0.717224 |
from sqlalchemy import Column, Integer, String, Float
from ..database import Base
from spacenet.schemas.resource import ResourceType
__all__ = ["Resource", "ResourceType", "ContinuousResource", "DiscreteResource"]
class Resource(Base):
__tablename__ = "resource"
id = Column(Integer, primary_key=True, ind... | true | true |
f7211bd5305aa8d6dd9cc38d64504cc0312f6ab1 | 812 | py | Python | Latte/ex5.py | Latte-inc/Learn-Python3.6 | f3568cf2f8413f8730c2297bc39ae890bb82d962 | [
"CC0-1.0"
] | 1 | 2021-10-15T05:43:19.000Z | 2021-10-15T05:43:19.000Z | Latte/ex5.py | Latte-inc/Learn-Python3.6 | f3568cf2f8413f8730c2297bc39ae890bb82d962 | [
"CC0-1.0"
] | null | null | null | Latte/ex5.py | Latte-inc/Learn-Python3.6 | f3568cf2f8413f8730c2297bc39ae890bb82d962 | [
"CC0-1.0"
] | 1 | 2022-01-13T10:34:55.000Z | 2022-01-13T10:34:55.000Z | # # This code is learn Python new code, variable format string start!
# Time 2020/05/15 00:44
# fatcat like .....
my_name = 'fatcat'
my_age = 24 #肥猫真的24岁哦!
my_height = 176 #是厘米(CM)哦!
my_weight = 93 #是公斤(Kg)哦!
my_eyes = 'black'
my_teeth = 'white'
my_hair = 'black'
#上述变量被赋予了两种类型 一种是赋予变量数字值,一种是赋予变量字符串。
pr... | 30.074074 | 73 | 0.685961 | 3
my_eyes = 'black'
my_teeth = 'white'
my_hair = 'black'
print(f"Let's talk about {my_name}.")
print(f"He's {my_height} CM.")
print(f"He's {my_weight} kilo.")
print("Actually that's not too heavy.")
print(f"His teeth are usually {my_teeth} depending on the coffee.")
total = my_age + my_height + my_weig... | true | true |
f7211beca92603a62d9cbaad149c7663ec244549 | 881 | py | Python | examples/pylab_examples/contour_corner_mask.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2019-04-15T09:40:53.000Z | 2019-04-15T09:40:53.000Z | examples/pylab_examples/contour_corner_mask.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | examples/pylab_examples/contour_corner_mask.py | argriffing/matplotlib | 5555f5463fb5f995a59f7651c0034a5d6a4c7e84 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Illustrate the difference between corner_mask=False and corner_mask=True
for masked contour plots.
"""
import matplotlib.pyplot as plt
import numpy as np
# Data to plot.
x, y = np.meshgrid(np.arange(7), np.arange(10))
z = np.sin(0.5*x)*np.cos(0.52*y)
# Mask various z values.
mask = np.zeros_... | 24.472222 | 72 | 0.658343 |
import matplotlib.pyplot as plt
import numpy as np
x, y = np.meshgrid(np.arange(7), np.arange(10))
z = np.sin(0.5*x)*np.cos(0.52*y)
mask = np.zeros_like(z, dtype=np.bool)
mask[2, 3:5] = True
mask[3:5, 4] = True
mask[7, 2] = True
mask[5, 0] = True
mask[0, 6] = True
z = np.ma.array(z, mask=mask)
corner_masks = [Fal... | true | true |
f7211e7c6967282019c097e1107691531485b132 | 847 | py | Python | authors/apps/notify/migrations/0001_initial.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/notify/migrations/0001_initial.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | 46 | 2019-01-08T13:16:41.000Z | 2021-04-30T20:47:08.000Z | authors/apps/notify/migrations/0001_initial.py | andela/Ah-backend-valkyrie | f0eb64c27e1fe37d5c81e4b9a8762dcf3c336a79 | [
"BSD-3-Clause"
] | 3 | 2019-01-07T08:21:59.000Z | 2019-09-20T06:43:18.000Z | # Generated by Django 2.1.5 on 2019-01-30 03:13
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 31.37037 | 118 | 0.651712 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f7211e7d3cba1e8c8ec791ea66706c3f0cbcf0a0 | 3,776 | py | Python | search_engine_parser/core/utils.py | justfly50/search-engine-parser | 0418867b3529980d5a4eb71899dec37092fe7df1 | [
"MIT"
] | 276 | 2019-02-01T22:48:46.000Z | 2021-10-17T21:25:13.000Z | search_engine_parser/core/utils.py | justfly50/search-engine-parser | 0418867b3529980d5a4eb71899dec37092fe7df1 | [
"MIT"
] | 95 | 2019-02-03T00:04:11.000Z | 2021-09-22T17:45:56.000Z | search_engine_parser/core/utils.py | justfly50/search-engine-parser | 0418867b3529980d5a4eb71899dec37092fe7df1 | [
"MIT"
] | 74 | 2019-02-02T11:04:17.000Z | 2021-10-09T23:49:25.000Z | import os
import random
import pickle
import hashlib
import aiohttp
from fake_useragent import UserAgent
FILEPATH = os.path.dirname(os.path.abspath(__file__))
# prevent caching
USER_AGENT_LIST = [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0",
"Mozilla/5.0 (Windows NT 10.... | 37.019608 | 101 | 0.598782 | import os
import random
import pickle
import hashlib
import aiohttp
from fake_useragent import UserAgent
FILEPATH = os.path.dirname(os.path.abspath(__file__))
USER_AGENT_LIST = [
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) Ap... | true | true |
f7211f5a04fad86d5e96b8e6c5fee8d770e20d1e | 5,324 | py | Python | leddar_ros2/leddar_sensor.py | JulienStanguennec-Leddartech/leddar_ros2 | 15f2674d8e7c472bc56c4be9cfd41f0d8d39c0bf | [
"BSD-3-Clause"
] | null | null | null | leddar_ros2/leddar_sensor.py | JulienStanguennec-Leddartech/leddar_ros2 | 15f2674d8e7c472bc56c4be9cfd41f0d8d39c0bf | [
"BSD-3-Clause"
] | null | null | null | leddar_ros2/leddar_sensor.py | JulienStanguennec-Leddartech/leddar_ros2 | 15f2674d8e7c472bc56c4be9cfd41f0d8d39c0bf | [
"BSD-3-Clause"
] | null | null | null |
import sys
import os
import time
#Import ros2 py
import rclpy
from rclpy.node import Node
#Import messages
import sensor_msgs.msg as sensor_msgs
import std_msgs.msg as std_msgs
#Import parameters (to read parameters)
from rclpy.parameter import Parameter
import numpy as np
import leddar
def point_cloud(points,... | 33.696203 | 150 | 0.655147 |
import sys
import os
import time
import rclpy
from rclpy.node import Node
import sensor_msgs.msg as sensor_msgs
import std_msgs.msg as std_msgs
from rclpy.parameter import Parameter
import numpy as np
import leddar
def point_cloud(points, parent_frame):
ros_dtype = sensor_msgs.PointField.... | true | true |
f7211f913ac30f34f3eb6b9c021cc65dc21ed271 | 3,962 | py | Python | StimRespFlow/DataStruct/WaveData.py | powerfulbean/StellarWave | 877d5113054f391f605c8e39f1a0f60f7bfeeee1 | [
"MIT"
] | 3 | 2020-09-16T06:14:00.000Z | 2021-03-17T00:05:06.000Z | StimRespFlow/DataStruct/WaveData.py | powerfulbean/StellarWave | 877d5113054f391f605c8e39f1a0f60f7bfeeee1 | [
"MIT"
] | null | null | null | StimRespFlow/DataStruct/WaveData.py | powerfulbean/StellarWave | 877d5113054f391f605c8e39f1a0f60f7bfeeee1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 9 23:21:06 2021
@author: ShiningStone
"""
import datetime
import numpy as np
from .Abstract import CWaveData,CTimeStampsGen
class CDateTimeStampsGen(CTimeStampsGen):
def __init__(self,start:datetime.datetime,delta:datetime.timedelta,nLen):
super().__in... | 39.62 | 128 | 0.575719 |
import datetime
import numpy as np
from .Abstract import CWaveData,CTimeStampsGen
class CDateTimeStampsGen(CTimeStampsGen):
def __init__(self,start:datetime.datetime,delta:datetime.timedelta,nLen):
super().__init__(start,delta,nLen)
class CBitalinoWaveData(CWaveData):
def __i... | true | true |
f721210773ad82cd155b9581ac29c5f1c9609d67 | 20,043 | py | Python | conda/models/match_spec.py | abar2day/najran | 3a30636f494275b0f259be7b1875fd0fd7759f20 | [
"BSD-3-Clause"
] | 1 | 2017-06-11T01:32:33.000Z | 2017-06-11T01:32:33.000Z | conda/models/match_spec.py | abar2day/najran | 3a30636f494275b0f259be7b1875fd0fd7759f20 | [
"BSD-3-Clause"
] | null | null | null | conda/models/match_spec.py | abar2day/najran | 3a30636f494275b0f259be7b1875fd0fd7759f20 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from abc import ABCMeta, abstractmethod, abstractproperty
from collections import Mapping
import re
from .channel import Channel, MultiChannel
from .dist import Dist
from .index_record import IndexRecord
from .v... | 32.857377 | 94 | 0.592925 |
from __future__ import absolute_import, division, print_function, unicode_literals
from abc import ABCMeta, abstractmethod, abstractproperty
from collections import Mapping
import re
from .channel import Channel, MultiChannel
from .dist import Dist
from .index_record import IndexRecord
from .version import BuildNumb... | true | true |
f721212419baf5ea18640832b738d3e1f17382a7 | 6,485 | py | Python | tests/integration-tests/cfn_stacks_factory.py | agobeaux/aws-parallelcluster | ec337c6b8341f9b84616b6bbbe8687a0a5f71126 | [
"Apache-2.0"
] | null | null | null | tests/integration-tests/cfn_stacks_factory.py | agobeaux/aws-parallelcluster | ec337c6b8341f9b84616b6bbbe8687a0a5f71126 | [
"Apache-2.0"
] | null | null | null | tests/integration-tests/cfn_stacks_factory.py | agobeaux/aws-parallelcluster | ec337c6b8341f9b84616b6bbbe8687a0a5f71126 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 39.066265 | 119 | 0.626831 |
import logging
import boto3
from botocore.exceptions import ClientError
from retrying import retry
from utils import retrieve_cfn_outputs, retrieve_cfn_resources, set_credentials, unset_credentials
class CfnStack:
def __init__(self, name, region, template, parameters=None):
self.name = name
... | true | true |
f721218a181e524dc4105ce1e8ccda9b8507b1c2 | 3,080 | py | Python | blog/blog/settings.py | zhaotao789/blog | de23e5a29b6aae2fc87829833f3fae256c55f5b3 | [
"MIT"
] | null | null | null | blog/blog/settings.py | zhaotao789/blog | de23e5a29b6aae2fc87829833f3fae256c55f5b3 | [
"MIT"
] | null | null | null | blog/blog/settings.py | zhaotao789/blog | de23e5a29b6aae2fc87829833f3fae256c55f5b3 | [
"MIT"
] | null | null | null | """
Django settings for blog project.
Generated by 'django-admin startproject' using Django 2.2.
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 os
# Buil... | 25.454545 | 91 | 0.696104 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'd120mv4fw)wcwekzk-r^1w5++9e^q_6qteo4-+n8kk4ei%i5$0'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f72121ecda5066fe0ef9c48035c6f35ba4a47c1b | 400 | py | Python | lino_tera/lib/coachings/choicelists.py | khchine5/tera | dd85aaefc2392fa831bcee7c258d37038e32aeb7 | [
"BSD-2-Clause"
] | null | null | null | lino_tera/lib/coachings/choicelists.py | khchine5/tera | dd85aaefc2392fa831bcee7c258d37038e32aeb7 | [
"BSD-2-Clause"
] | null | null | null | lino_tera/lib/coachings/choicelists.py | khchine5/tera | dd85aaefc2392fa831bcee7c258d37038e32aeb7 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Copyright 2017-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""The choicelists for this plugin.
"""
from lino.api import dd, _
class PartnerTariffs(dd.ChoiceList):
verbose_name = _("Client tariff")
verbose_name_plural = _("Client tariffs")
add = PartnerTariff... | 18.181818 | 45 | 0.67 |
from lino.api import dd, _
class PartnerTariffs(dd.ChoiceList):
verbose_name = _("Client tariff")
verbose_name_plural = _("Client tariffs")
add = PartnerTariffs.add_item
add('10', _("Plain"), 'plain')
add('20', _("Reduced"), 'reduced')
| true | true |
f7212251e63dcb5ce319603d8ff0812abad4359b | 1,095 | py | Python | synapse/resources/packages-plugin/yum-pkg.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | 1 | 2016-06-23T05:56:53.000Z | 2016-06-23T05:56:53.000Z | synapse/resources/packages-plugin/yum-pkg.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | null | null | null | synapse/resources/packages-plugin/yum-pkg.py | mrmuxl/synapse-agent | 615ccc8faefa0f7d66d070a7444fe57e67e3bae1 | [
"MIT"
] | null | null | null | from synapse.syncmd import exec_cmd
from synapse.synapse_exceptions import ResourceException
from synapse.logger import logger
log = logger('yum-pkg')
def install(name):
ret = exec_cmd("/usr/bin/yum -q -y install {0}".format(name))
if ret['returncode'] != 0:
raise ResourceException(ret['stderr'])
d... | 28.076923 | 79 | 0.663014 | from synapse.syncmd import exec_cmd
from synapse.synapse_exceptions import ResourceException
from synapse.logger import logger
log = logger('yum-pkg')
def install(name):
ret = exec_cmd("/usr/bin/yum -q -y install {0}".format(name))
if ret['returncode'] != 0:
raise ResourceException(ret['stderr'])
d... | true | true |
f7212358f16c2908668c9722bd9e47633e14b4ef | 2,154 | py | Python | sensirion_shdlc_sensorbridge/i2c_errors.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | null | null | null | sensirion_shdlc_sensorbridge/i2c_errors.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | 1 | 2021-03-28T22:15:29.000Z | 2021-11-03T09:06:14.000Z | sensirion_shdlc_sensorbridge/i2c_errors.py | Sensirion/python-shdlc-sensorbridge | c441c17d89697ecf0f7b61955f54c3da195e30e6 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# (c) Copyright 2020 Sensirion AG, Switzerland
from __future__ import absolute_import, division, print_function
import logging
log = logging.getLogger(__name__)
class SensorBridgeI2cError(IOError):
"""
I2C transceive error.
"""
def __init__(self, code, message="Unknown"):
... | 25.642857 | 81 | 0.654132 |
from __future__ import absolute_import, division, print_function
import logging
log = logging.getLogger(__name__)
class SensorBridgeI2cError(IOError):
def __init__(self, code, message="Unknown"):
super(SensorBridgeI2cError, self).__init__(
"I2C transceive error: {}".format(message)
... | true | true |
f721236e30c2bc62859814934c24d2d0a6124a36 | 1,534 | py | Python | tests/ecr/data_generator/test_vessel_parser.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | tests/ecr/data_generator/test_vessel_parser.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | tests/ecr/data_generator/test_vessel_parser.py | zhawan/maro | d8c98deea4296cdcb90efd1fb59bc571cec3a2ef | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import unittest
import yaml
from maro.data_lib.ecr.vessel_parser import VesselsParser
from maro.data_lib.ecr.entities import VesselSetting
conf_str = """
vessels:
rt1_vessel_001:
capacity: 92400
parking:
duration: 1
noise... | 25.566667 | 75 | 0.666232 |
import unittest
import yaml
from maro.data_lib.ecr.vessel_parser import VesselsParser
from maro.data_lib.ecr.entities import VesselSetting
conf_str = """
vessels:
rt1_vessel_001:
capacity: 92400
parking:
duration: 1
noise: 0
route:
initial_port_name: supply_port_001
route_nam... | true | true |
f72123b570cec67b1077598e4da57ff2404e136f | 8,077 | py | Python | corehq/util/es/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | corehq/util/es/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | 94 | 2020-12-11T06:57:31.000Z | 2022-03-15T10:24:06.000Z | corehq/util/es/interface.py | dimagilg/commcare-hq | ea1786238eae556bb7f1cbd8d2460171af1b619c | [
"BSD-3-Clause"
] | null | null | null | import abc
import logging
import traceback
from django.conf import settings
from corehq.pillows.mappings.utils import transform_for_es7
from corehq.util.es.elasticsearch import bulk, scan
class AbstractElasticsearchInterface(metaclass=abc.ABCMeta):
def __init__(self, es):
self.es = es
def get_alias... | 39.985149 | 112 | 0.668317 | import abc
import logging
import traceback
from django.conf import settings
from corehq.pillows.mappings.utils import transform_for_es7
from corehq.util.es.elasticsearch import bulk, scan
class AbstractElasticsearchInterface(metaclass=abc.ABCMeta):
def __init__(self, es):
self.es = es
def get_alias... | true | true |
f72125bd49bf7f1f45aab75707173700a233a682 | 2,262 | py | Python | brave/overlays/effect.py | datagutt/brave | 5b4de55146645f96870ffc544859e6f2bb9ec735 | [
"Apache-2.0"
] | 572 | 2018-10-25T10:52:21.000Z | 2022-03-09T18:02:20.000Z | brave/overlays/effect.py | datagutt/brave | 5b4de55146645f96870ffc544859e6f2bb9ec735 | [
"Apache-2.0"
] | 50 | 2018-11-06T08:53:27.000Z | 2022-01-04T17:00:37.000Z | brave/overlays/effect.py | datagutt/brave | 5b4de55146645f96870ffc544859e6f2bb9ec735 | [
"Apache-2.0"
] | 130 | 2018-11-01T14:50:46.000Z | 2022-03-10T20:31:41.000Z | from brave.overlays.overlay import Overlay
from gi.repository import Gst
class EffectOverlay(Overlay):
'''
For doing applying a video effect.
'''
def permitted_props(self):
return {
**super().permitted_props(),
'effect_name': {
'type': 'str',
... | 41.888889 | 100 | 0.525199 | from brave.overlays.overlay import Overlay
from gi.repository import Gst
class EffectOverlay(Overlay):
def permitted_props(self):
return {
**super().permitted_props(),
'effect_name': {
'type': 'str',
'default': 'edgetv',
'permitted_v... | true | true |
f7212703196fd6c35cdef4b889edc2bf6b134e91 | 7,399 | py | Python | pytest_testrail/conftest.py | harmonm/pytest-testrail | cfd667b33cc857dd65c8531823859cd871aff525 | [
"MIT"
] | null | null | null | pytest_testrail/conftest.py | harmonm/pytest-testrail | cfd667b33cc857dd65c8531823859cd871aff525 | [
"MIT"
] | null | null | null | pytest_testrail/conftest.py | harmonm/pytest-testrail | cfd667b33cc857dd65c8531823859cd871aff525 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import os
import sys
if sys.version_info.major == 2:
# python2
import ConfigParser as configparser
else:
# python3
import configparser
from .plugin import PyTestRailPlugin
from .testrail_api import APIClient
def pytest_addoption(parser):
group = parser.getgroup('testrail')... | 41.105556 | 140 | 0.626571 |
import os
import sys
if sys.version_info.major == 2:
import ConfigParser as configparser
else:
import configparser
from .plugin import PyTestRailPlugin
from .testrail_api import APIClient
def pytest_addoption(parser):
group = parser.getgroup('testrail')
group.addoption(
'--testrail... | true | true |
f72128027575513090564f54bc3c085deb980059 | 666 | py | Python | lldb/test/API/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | 2 | 2021-11-20T04:04:47.000Z | 2022-01-06T07:44:23.000Z | lldb/test/API/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | lldb/test/API/lang/swift/po/sys_types/TestSwiftPOSysTypes.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | # TestSwiftPOSysTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONT... | 39.176471 | 80 | 0.657658 |
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *
lldbinline.MakeInlineTest(__file__, globals(),
decorators=[swiftTest,skipIf(oslist=['windows'])])
| true | true |
f721282c9bbbd6198fca4dcb39f852eed304a1be | 16,248 | py | Python | brian2/codegen/generators/numpy_generator.py | SimonAltrogge/brian2 | 6463c368a8277041051bf5ae4816f0dd5b6e057c | [
"BSD-2-Clause"
] | 674 | 2015-01-14T11:05:39.000Z | 2022-03-29T04:53:50.000Z | brian2/codegen/generators/numpy_generator.py | JongwanKim2090/brian2 | c212a57cb992b766786b5769ebb830ff12d8a8ad | [
"BSD-2-Clause"
] | 937 | 2015-01-05T13:24:22.000Z | 2022-03-25T13:10:13.000Z | brian2/codegen/generators/numpy_generator.py | JongwanKim2090/brian2 | c212a57cb992b766786b5769ebb830ff12d8a8ad | [
"BSD-2-Clause"
] | 237 | 2015-01-05T13:54:16.000Z | 2022-03-15T22:16:32.000Z |
import itertools
import numpy as np
from brian2.parsing.bast import brian_dtype_from_dtype
from brian2.parsing.rendering import NumpyNodeRenderer
from brian2.core.functions import DEFAULT_FUNCTIONS, timestep
from brian2.core.variables import ArrayVariable
from brian2.utils.stringtools import get_identifiers, word_su... | 46.959538 | 110 | 0.551576 |
import itertools
import numpy as np
from brian2.parsing.bast import brian_dtype_from_dtype
from brian2.parsing.rendering import NumpyNodeRenderer
from brian2.core.functions import DEFAULT_FUNCTIONS, timestep
from brian2.core.variables import ArrayVariable
from brian2.utils.stringtools import get_identifiers, word_su... | true | true |
f721282f6a2dc461afc65e2af7a6340bab2f41d6 | 7,584 | py | Python | cfripper/rules/wildcard_principals.py | claytonbrown/cfripper | 869eb5861da3fcfaa5e2f5e877fa9c30f60cfce9 | [
"Apache-2.0"
] | 360 | 2018-08-08T12:34:58.000Z | 2022-03-25T17:01:41.000Z | cfripper/rules/wildcard_principals.py | Skyscanner/cfripper | 1bc3ff483ac9c126037f796950ebe52cf463ac17 | [
"Apache-2.0"
] | 40 | 2018-11-26T07:08:15.000Z | 2022-03-02T09:10:45.000Z | cfripper/rules/wildcard_principals.py | claytonbrown/cfripper | 869eb5861da3fcfaa5e2f5e877fa9c30f60cfce9 | [
"Apache-2.0"
] | 51 | 2018-11-09T11:46:32.000Z | 2022-03-28T08:47:28.000Z | __all__ = ["GenericWildcardPrincipalRule", "PartialWildcardPrincipalRule", "FullWildcardPrincipalRule"]
import logging
import re
from typing import Dict, Optional
from pycfmodel.model.cf_model import CFModel
from pycfmodel.model.resources.iam_managed_policy import IAMManagedPolicy
from pycfmodel.model.resources.iam_po... | 54.956522 | 120 | 0.587421 | __all__ = ["GenericWildcardPrincipalRule", "PartialWildcardPrincipalRule", "FullWildcardPrincipalRule"]
import logging
import re
from typing import Dict, Optional
from pycfmodel.model.cf_model import CFModel
from pycfmodel.model.resources.iam_managed_policy import IAMManagedPolicy
from pycfmodel.model.resources.iam_po... | true | true |
f72128c8178af94dd8a0a21b6e9bdb1ebcf3a076 | 2,575 | py | Python | graphs/karger.py | jenia90/Python | 696fb4a681ad9e4d84e0d2b894daf449a3e30b24 | [
"MIT"
] | 145,614 | 2016-07-21T05:40:05.000Z | 2022-03-31T22:17:22.000Z | graphs/karger.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 3,987 | 2016-07-28T17:31:25.000Z | 2022-03-30T23:07:46.000Z | graphs/karger.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 40,014 | 2016-07-26T15:14:41.000Z | 2022-03-31T22:23:03.000Z | """
An implementation of Karger's Algorithm for partitioning a graph.
"""
from __future__ import annotations
import random
# Adjacency list representation of this graph:
# https://en.wikipedia.org/wiki/File:Single_run_of_Karger%E2%80%99s_Mincut_algorithm.svg
TEST_GRAPH = {
"1": ["2", "3", "4", "5"],
"2": ["1... | 29.597701 | 88 | 0.572816 |
from __future__ import annotations
import random
TEST_GRAPH = {
"1": ["2", "3", "4", "5"],
"2": ["1", "3", "4", "5"],
"3": ["1", "2", "4", "5", "10"],
"4": ["1", "2", "3", "5", "6"],
"5": ["1", "2", "3", "4", "7"],
"6": ["7", "8", "9", "10", "4"],
"7": ["6", "8", "9", "10", "5"],
"8... | true | true |
f721291ec9a303b02a2cdf00dbe42788ad4a0a98 | 1,661 | py | Python | setup.py | chermed/assembly | 4c993d19bc9d33c1641323e03231e9ecad711b38 | [
"MIT"
] | 176 | 2019-11-16T19:44:08.000Z | 2021-09-10T22:16:04.000Z | setup.py | chermed/assembly | 4c993d19bc9d33c1641323e03231e9ecad711b38 | [
"MIT"
] | 12 | 2019-11-21T02:02:07.000Z | 2020-02-17T21:45:57.000Z | setup.py | chermed/assembly | 4c993d19bc9d33c1641323e03231e9ecad711b38 | [
"MIT"
] | 12 | 2019-11-20T08:07:11.000Z | 2021-02-27T09:52:06.000Z | """
Assembly
"""
import os
from setuptools import setup, find_packages
base_dir = os.path.dirname(__file__)
__about__ = {}
with open(os.path.join(base_dir, "assembly", "about.py")) as f:
exec(f.read(), __about__)
with open('requirements.txt') as f:
install_requires = f.read().splitlines()
with open("READM... | 27.683333 | 81 | 0.615292 |
import os
from setuptools import setup, find_packages
base_dir = os.path.dirname(__file__)
__about__ = {}
with open(os.path.join(base_dir, "assembly", "about.py")) as f:
exec(f.read(), __about__)
with open('requirements.txt') as f:
install_requires = f.read().splitlines()
with open("README.md", "r") as f:... | true | true |
f7212933bf16d8d621d170fadea4f1c611eeef47 | 2,438 | py | Python | .history/postImages/index_20201006214330.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | 2 | 2020-10-21T22:14:15.000Z | 2020-10-21T22:14:16.000Z | .history/postImages/index_20201006214330.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | null | null | null | .history/postImages/index_20201006214330.py | Lambda-School-Labs/Labs27-C-Bridges-To-Prosperity-BE | 9a8289d8550115362c46dea3ed8570b789c09a10 | [
"MIT"
] | null | null | null | import csv
import requests
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
finCsv = fin[1:]
# url = https://b2ptc.herokuapp.com/bridges
finalCsv = df[1:]
obj = {}
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_img':x[2],'after_im... | 30.475 | 97 | 0.454471 | import csv
import requests
df = open("bridgeData3.csv",'r').readlines()
fin = open('final.csv','r').readlines()
finCsv = fin[1:]
finalCsv = df[1:]
obj = {}
for i in finalCsv:
x = i.split(',')
obj[x[1]] = {'bridge_name':x[0],'proj_code':x[1],'before_img':x[2],'after_img':x[3][0:-1]}
finalObj = {}
for i in finC... | true | true |
f7212939f549dcbfa9bf8b9ff6fb82924b643d38 | 1,241 | py | Python | harnesses/dict_conv.py | ujjwalsh/oniguruma | 604ea58f210b301d572b9fcf89d6e03fbb1df1f9 | [
"BSD-2-Clause"
] | 1,793 | 2015-07-20T14:14:18.000Z | 2022-03-29T13:00:16.000Z | harnesses/dict_conv.py | ujjwalsh/oniguruma | 604ea58f210b301d572b9fcf89d6e03fbb1df1f9 | [
"BSD-2-Clause"
] | 183 | 2015-09-04T14:00:57.000Z | 2022-03-19T15:52:13.000Z | harnesses/dict_conv.py | ujjwalsh/oniguruma | 604ea58f210b301d572b9fcf89d6e03fbb1df1f9 | [
"BSD-2-Clause"
] | 339 | 2015-09-03T11:13:46.000Z | 2022-03-20T08:21:15.000Z | # -*- coding: utf-8 -*-
# dict_conv.py (Python3 script)
import sys
ENC_UTF16_BE = 1
ENC_UTF16_LE = 2
def add_char(enc, s, c):
if enc == ENC_UTF16_BE:
s += "\\x00"
s += c
if enc == ENC_UTF16_LE:
s += "\\x00"
return s
def conv(enc, s):
n = len(s)
r = ""
i = 0
while i < n:
c = s[i]
i... | 17 | 75 | 0.498791 |
import sys
ENC_UTF16_BE = 1
ENC_UTF16_LE = 2
def add_char(enc, s, c):
if enc == ENC_UTF16_BE:
s += "\\x00"
s += c
if enc == ENC_UTF16_LE:
s += "\\x00"
return s
def conv(enc, s):
n = len(s)
r = ""
i = 0
while i < n:
c = s[i]
if c == '\\':
c = s[i+1]
if c == '\\' or c =... | true | true |
f721296a022523474df762cfe7ddb9431b342931 | 1,300 | py | Python | src/relaxed/infer/hypothesis_test.py | gradhep/smooth | 9ed6f1d622fb5346c46f1b9f62aed886b73fe09a | [
"BSD-3-Clause"
] | 4 | 2020-05-18T17:43:07.000Z | 2020-07-13T12:05:10.000Z | src/relaxed/infer/hypothesis_test.py | gradhep/relaxed | 9ed6f1d622fb5346c46f1b9f62aed886b73fe09a | [
"BSD-3-Clause"
] | 13 | 2021-05-13T20:59:55.000Z | 2022-03-25T12:04:44.000Z | src/relaxed/infer/hypothesis_test.py | gradhep/relaxed | 9ed6f1d622fb5346c46f1b9f62aed886b73fe09a | [
"BSD-3-Clause"
] | 3 | 2020-05-21T13:24:10.000Z | 2021-04-22T12:36:33.000Z | """Calculate expected CLs values with hypothesis tests."""
from __future__ import annotations
__all__ = ("hypotest",)
from functools import partial
import jax.numpy as jnp
import pyhf
from chex import Array
from jax import jit
from ..mle import fit, fixed_poi_fit
@partial(jit, static_argnames=["model", "return_ml... | 30.232558 | 81 | 0.698462 | from __future__ import annotations
__all__ = ("hypotest",)
from functools import partial
import jax.numpy as jnp
import pyhf
from chex import Array
from jax import jit
from ..mle import fit, fixed_poi_fit
@partial(jit, static_argnames=["model", "return_mle_pars"])
def hypotest(
test_poi: float,
data: Ar... | true | true |
f7212c9ffcc95acbd3066fc3058f89d2b03ec98b | 1,750 | py | Python | cheeseprism/event.py | msabramo/CheesePrism | 3880528fb5a83fc650860d41e77729853081d404 | [
"BSD-2-Clause"
] | null | null | null | cheeseprism/event.py | msabramo/CheesePrism | 3880528fb5a83fc650860d41e77729853081d404 | [
"BSD-2-Clause"
] | null | null | null | cheeseprism/event.py | msabramo/CheesePrism | 3880528fb5a83fc650860d41e77729853081d404 | [
"BSD-2-Clause"
] | null | null | null | from zope.interface import Attribute
from zope.interface import Interface
from zope.interface import implements
class IIndexEvent(Interface):
"""
An lower level event involving the index
"""
class IIndexUpdate(Interface):
"""
An low level event involving the index
"""
class IPackag... | 22.727273 | 93 | 0.668571 | from zope.interface import Attribute
from zope.interface import Interface
from zope.interface import implements
class IIndexEvent(Interface):
class IIndexUpdate(Interface):
class IPackageEvent(IIndexEvent):
path = Attribute('Path to package')
class IPackageAdded(IPackageEvent):
class IPackageRemov... | true | true |
f7212d29fbadd9f4d8375d99f948230868b7821d | 520 | py | Python | tests/test_parallel.py | seznam/flexp | 84043150a80474809d066a06db02cbbd858f349e | [
"BSD-3-Clause"
] | 6 | 2018-05-30T10:41:56.000Z | 2020-08-05T16:47:54.000Z | tests/test_parallel.py | seznam/flexp | 84043150a80474809d066a06db02cbbd858f349e | [
"BSD-3-Clause"
] | 39 | 2018-07-11T14:44:01.000Z | 2019-08-06T12:27:43.000Z | tests/test_parallel.py | seznam/flexp | 84043150a80474809d066a06db02cbbd858f349e | [
"BSD-3-Clause"
] | 3 | 2018-07-11T14:54:39.000Z | 2019-04-07T04:47:29.000Z | from __future__ import print_function
import time
import unittest
from flexp.flow.parallel import parallelize
def add_two(x):
return x + 2
class TestParallel(unittest.TestCase):
def test_parallel(self):
count = 50
data = range(0, count)
start = time.clock()
res = list(par... | 20.8 | 55 | 0.617308 | from __future__ import print_function
import time
import unittest
from flexp.flow.parallel import parallelize
def add_two(x):
return x + 2
class TestParallel(unittest.TestCase):
def test_parallel(self):
count = 50
data = range(0, count)
start = time.clock()
res = list(par... | true | true |
f7212eed7b4fc035239879fd2bda4106c25fb513 | 2,399 | py | Python | CNN/extract.py | skywolf829/CSE5559_Final_Project | c7b29e6fc0cbfd81252edbadaa0d733a0c24bee7 | [
"MIT"
] | null | null | null | CNN/extract.py | skywolf829/CSE5559_Final_Project | c7b29e6fc0cbfd81252edbadaa0d733a0c24bee7 | [
"MIT"
] | null | null | null | CNN/extract.py | skywolf829/CSE5559_Final_Project | c7b29e6fc0cbfd81252edbadaa0d733a0c24bee7 | [
"MIT"
] | 1 | 2020-05-02T05:58:55.000Z | 2020-05-02T05:58:55.000Z | ## Basic Python libraries
import os
from PIL import Image
## Deep learning and array processing libraries
import numpy as np
import torch
import torch.nn.functional as F
import torchvision
import torchvision.transforms as transforms
## Inner-project imports
from model import EncoderCNN, DecoderRNN
##### Code begi... | 28.903614 | 132 | 0.709462 | rt Image
.nn.functional as F
import torchvision
import torchvision.transforms as transforms
derCNN, DecoderRNN
ork_directory}encoder-5-3000.pkl'
if torch.cuda.is_available():
compute_device = torch.device('cuda:0')
else:
compute_device = torch.device('cpu')
print(f'Using device: {compute_device}')
tran... | true | true |
f72130741418bf63d0a3ae4aa5d952c8d92a5ac0 | 72 | py | Python | python/dcf-tools/dcf2dev/__init__.py | tshu/lely-core | fd0ceff2db726af6d2a766039a0b5a6d33d056e8 | [
"Apache-2.0"
] | 4 | 2020-12-27T11:31:57.000Z | 2022-02-09T11:32:08.000Z | python/dcf-tools/dcf2dev/__init__.py | DroidDrive/lely-core | 2ec4560f513264a53d2afaedecdae4a49a39023c | [
"Apache-2.0"
] | null | null | null | python/dcf-tools/dcf2dev/__init__.py | DroidDrive/lely-core | 2ec4560f513264a53d2afaedecdae4a49a39023c | [
"Apache-2.0"
] | 1 | 2022-01-03T01:41:59.000Z | 2022-01-03T01:41:59.000Z | from .cdevice import CDevice, CObject, CSubObject, CValue # noqa: F401
| 36 | 71 | 0.763889 | from .cdevice import CDevice, CObject, CSubObject, CValue
| true | true |
f72130c7c2fc80d8513e06cfe21833534c1bec7a | 1,022 | py | Python | tools/grafana/daemon/lib/parse/sen_bin_parse.py | Flowm/move-on-helium-sensors | 3794d38671e1976c9801bcb8a9639465cdddb731 | [
"Apache-2.0"
] | 1 | 2021-11-11T01:49:28.000Z | 2021-11-11T01:49:28.000Z | tools/grafana/daemon/lib/parse/sen_bin_parse.py | Flowm/move-on-helium-sensors | 3794d38671e1976c9801bcb8a9639465cdddb731 | [
"Apache-2.0"
] | null | null | null | tools/grafana/daemon/lib/parse/sen_bin_parse.py | Flowm/move-on-helium-sensors | 3794d38671e1976c9801bcb8a9639465cdddb731 | [
"Apache-2.0"
] | null | null | null | import logging
from subprocess import Popen, PIPE, STDOUT
from lib.parse.sen_ascii_parse import SenAsciiParse
class SenBinParse:
def __init__(self):
self.ascii_parser = SenAsciiParse()
def parse_packet(self, packet, with_header=True):
if len(packet) < 10:
return
length = ... | 28.388889 | 106 | 0.596869 | import logging
from subprocess import Popen, PIPE, STDOUT
from lib.parse.sen_ascii_parse import SenAsciiParse
class SenBinParse:
def __init__(self):
self.ascii_parser = SenAsciiParse()
def parse_packet(self, packet, with_header=True):
if len(packet) < 10:
return
length = ... | true | true |
f72130ca917b168f52b2f7177e043fcb23096456 | 1,897 | py | Python | tools/concatlibs.py | ZECTBynmo/tacnode | 344d0a10b3766c47538e4917e0ef4d59e07f9b9e | [
"BSD-2-Clause"
] | 28 | 2015-01-28T11:17:04.000Z | 2022-02-07T12:48:22.000Z | tools/concatlibs.py | ZECTBynmo/tacnode | 344d0a10b3766c47538e4917e0ef4d59e07f9b9e | [
"BSD-2-Clause"
] | null | null | null | tools/concatlibs.py | ZECTBynmo/tacnode | 344d0a10b3766c47538e4917e0ef4d59e07f9b9e | [
"BSD-2-Clause"
] | 5 | 2015-01-29T19:34:45.000Z | 2019-03-17T11:15:26.000Z | import os
import sys
##############
# NOTE: You will need to build boost
# On windows, use the following command from the visual studio command
# prompt (after running boostrap.bat)
#
# bjam --build-dir=c:\boost --build-type=complete --toolset=msvc-9.0 address-model=64 architecture=x86 --with-system
##############
cu... | 30.596774 | 153 | 0.698471 | import os
import sys
gd-1_52.lib";
inputLibs = [
currentPath+'/'+config+"/lib/node.lib",
currentPath+'/build/'+config+"/lib/v8_base.lib",
currentPath+'/build/'+config+"/lib/v8_nosnapshot.lib",
currentPath+'/build/'+config+"/lib/v8_snapshot.lib",
currentPath+'/'+config+"/lib/libuv.lib",
curre... | true | true |
f72130ecddae709848f93c0001cf6167db8fb692 | 3,950 | py | Python | google/ads/google_ads/v4/proto/enums/mobile_app_vendor_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v4/proto/enums/mobile_app_vendor_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v4/proto/enums/mobile_app_vendor_pb2.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v4/proto/enums/mobile_app_vendor.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf impor... | 38.72549 | 649 | 0.786076 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f72131ada34d81d06455b0c8be1ca2dd4d1e24ee | 5,159 | py | Python | checkpoints/sum/train/hotel_mask/batch_size_16-notes_new_subword/code_snapshot/generate_from_lm.py | Saibo-creator/Text-Summrize-Project | d5ce54193110452a18cc0b223360c2bd004b4b28 | [
"Apache-2.0"
] | null | null | null | checkpoints/sum/train/hotel_mask/batch_size_16-notes_new_subword/code_snapshot/generate_from_lm.py | Saibo-creator/Text-Summrize-Project | d5ce54193110452a18cc0b223360c2bd004b4b28 | [
"Apache-2.0"
] | null | null | null | checkpoints/sum/train/hotel_mask/batch_size_16-notes_new_subword/code_snapshot/generate_from_lm.py | Saibo-creator/Text-Summrize-Project | d5ce54193110452a18cc0b223360c2bd004b4b28 | [
"Apache-2.0"
] | null | null | null | # generate_from_lm.py
"""
Load a trained language model and generate text
Example usage:
PYTHONPATH=. python generate_from_lm.py \
--init="Although the food" --tau=0.5 \
--sample_method=gumbel --g_eps=1e-5 \
--load_model='checkpoints/lm/mlstm/hotel/batch_size_64/lm_e9_2.93.pt' \
--dataset='hotel' --cpu=1 --sample_met... | 33.070513 | 104 | 0.629192 |
import pdb
import torch
import torch.nn as nn
from models.custom_parallel import DataParallelModel
from models.mlstm import StackedLSTMEncoderDecoder
from models.nn_utils import move_to_cuda, setup_gpus, logits_to_prob, prob_to_vocab_id
from project_settings import HParams, PAD_ID, DatasetConfig
from utils import l... | true | true |
f721321d98af2205ce169d3d88af0b431e7731ea | 1,235 | py | Python | sysinv/sysinv/sysinv/sysinv/objects/interface_base.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/objects/interface_base.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/objects/interface_base.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 1 | 2021-01-05T16:24:58.000Z | 2021-01-05T16:24:58.000Z | #
# Copyright (c) 2013-2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
#
from sysinv.db import api as db_api
from sysinv.objects import base
from sysinv.objects import utils
def _get_interface_name_list(field, db_object):
ifnames... | 25.204082 | 53 | 0.637247 |
from sysinv.db import api as db_api
from sysinv.objects import base
from sysinv.objects import utils
def _get_interface_name_list(field, db_object):
ifnames = []
for i in db_object[field]:
ifnames.append(i['ifname'])
return ifnames
class InterfaceBase(base.SysinvObject):
dbapi = d... | true | true |
f72133aff214d90410fb19b8ccb50eafa1390f3b | 12,732 | py | Python | datalad/customremotes/tests/test_archives.py | christinerogers/datalad | 8b91f3767b45371e213aa7ade146a290a13c00f2 | [
"MIT"
] | 1 | 2021-06-11T19:54:19.000Z | 2021-06-11T19:54:19.000Z | datalad/customremotes/tests/test_archives.py | christinerogers/datalad | 8b91f3767b45371e213aa7ade146a290a13c00f2 | [
"MIT"
] | 1 | 2019-08-30T14:45:33.000Z | 2019-08-30T14:45:33.000Z | datalad/customremotes/tests/test_archives.py | christinerogers/datalad | 8b91f3767b45371e213aa7ade146a290a13c00f2 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | 37.011628 | 116 | 0.654807 |
"VERSION 1", re_=True, match=False)
ok_file_has_content(protocol_file, "GETAVAILABILITY", re_=True, match=False)
ok_file_has_content(protocol_file, "#!/bin/bash", re_=True, match=False)
else:
assert_false(isinstance(annex.cmd_call_wrapper.protocol, AnnexExchangeProtocol))
# verify th... | true | true |
f7213680738375f96a2084c20c14a5024e5d194e | 5,679 | py | Python | salt/states/postgres_extension.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | null | null | null | salt/states/postgres_extension.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | null | null | null | salt/states/postgres_extension.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Management of PostgreSQL extensions (e.g.: postgis)
===================================================
The postgres_extensions module is used to create and manage Postgres extensions.
.. code-block:: yaml
adminpack:
postgres_extension.present
'''
# Import Python libs
import lo... | 26.537383 | 80 | 0.559606 |
import logging
from salt.modules import postgres
log = logging.getLogger(__name__)
def __virtual__():
return 'postgres.create_extension' in __salt__
def present(name,
if_not_exists=None,
schema=None,
ext_version=None,
from_version=None,
user=None... | true | true |
f72136d4758f64cffd134ac0eafb88595992711c | 10,305 | py | Python | fairseq/progress_bar.py | jxhe/fairseq | 214e3fed5619733efa4f1f82c61db58e5ce08ad8 | [
"MIT"
] | null | null | null | fairseq/progress_bar.py | jxhe/fairseq | 214e3fed5619733efa4f1f82c61db58e5ce08ad8 | [
"MIT"
] | null | null | null | fairseq/progress_bar.py | jxhe/fairseq | 214e3fed5619733efa4f1f82c61db58e5ce08ad8 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Wrapper around various loggers and progress bars (e.g., tqdm).
"""
from collections import OrderedDict
from contextlib import contextmana... | 33.028846 | 104 | 0.612033 |
from collections import OrderedDict
from contextlib import contextmanager
import json
import logging
from numbers import Number
import os
import sys
import torch
from fairseq import distributed_utils
from fairseq.meters import AverageMeter, StopwatchMeter, TimeMeter
logger = logging.getLogger(__name__)
def ... | true | true |
f72137bf78f559bfe97edbab30e7988e13d94b58 | 327 | py | Python | truck_microservice/truck_microservice/urls.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck_microservice/urls.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | truck_microservice/truck_microservice/urls.py | getnosleep/VirtualUnjam | bae08eec9756c963dab409c6e4e7397ef019cc8a | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from rest_framework import routers
router = routers.DefaultRouter()
urlpatterns = [
path('', include(router.urls)),
path('api-auth/', include('rest_framework.urls')),
path('admin/', admin.site.urls),
path('api/', include('truck.urls... | 27.25 | 54 | 0.700306 | from django.contrib import admin
from django.urls import path, include
from rest_framework import routers
router = routers.DefaultRouter()
urlpatterns = [
path('', include(router.urls)),
path('api-auth/', include('rest_framework.urls')),
path('admin/', admin.site.urls),
path('api/', include('truck.urls... | true | true |
f72137f9085fd5053b6df852024426c114db9e8c | 7,174 | py | Python | cogdl/models/emb/netsmf.py | wsyCUHK/cogdl | 7a0e36326fc653d85378e3845ec14ebd9425a9b6 | [
"MIT"
] | 1 | 2021-12-16T11:53:20.000Z | 2021-12-16T11:53:20.000Z | cogdl/models/emb/netsmf.py | wsyCUHK/cogdl | 7a0e36326fc653d85378e3845ec14ebd9425a9b6 | [
"MIT"
] | null | null | null | cogdl/models/emb/netsmf.py | wsyCUHK/cogdl | 7a0e36326fc653d85378e3845ec14ebd9425a9b6 | [
"MIT"
] | null | null | null | import numpy as np
import networkx as nx
import scipy.sparse as sp
from sklearn import preprocessing
from sklearn.utils.extmath import randomized_svd
from multiprocessing import Pool
from tqdm import tqdm
import time
from cogdl.utils import alias_draw, alias_setup
from .. import BaseModel
class NetSMF(BaseModel):
... | 41.229885 | 117 | 0.598411 | import numpy as np
import networkx as nx
import scipy.sparse as sp
from sklearn import preprocessing
from sklearn.utils.extmath import randomized_svd
from multiprocessing import Pool
from tqdm import tqdm
import time
from cogdl.utils import alias_draw, alias_setup
from .. import BaseModel
class NetSMF(BaseModel):
... | true | true |
f7213978ccd0f01659e3efbbcfb25973a4e526b4 | 877 | py | Python | CTFd/forms/challenges.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | CTFd/forms/challenges.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | CTFd/forms/challenges.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | from wtforms import MultipleFileField, SelectField, StringField
from wtforms.validators import InputRequired
from CTFd.forms import BaseForm
from CTFd.forms.fields import SubmitField
class ChallengeSearchForm(BaseForm):
field = SelectField(
"Search Field",
choices=[
("name"... | 28.290323 | 79 | 0.608894 | from wtforms import MultipleFileField, SelectField, StringField
from wtforms.validators import InputRequired
from CTFd.forms import BaseForm
from CTFd.forms.fields import SubmitField
class ChallengeSearchForm(BaseForm):
field = SelectField(
"Search Field",
choices=[
("name"... | true | true |
f72139a7d81181702d6d08b0921ed75b1e2aa778 | 2,422 | py | Python | staicoin/consensus/block_rewards.py | d00kSI/staicoin-blockchain | 5783a48271c8145c8eea93169df13a9ed32817ad | [
"Apache-2.0"
] | 1 | 2021-12-03T02:39:29.000Z | 2021-12-03T02:39:29.000Z | staicoin/consensus/block_rewards.py | d00kSI/staicoin-blockchain | 5783a48271c8145c8eea93169df13a9ed32817ad | [
"Apache-2.0"
] | null | null | null | staicoin/consensus/block_rewards.py | d00kSI/staicoin-blockchain | 5783a48271c8145c8eea93169df13a9ed32817ad | [
"Apache-2.0"
] | null | null | null | from staicoin.util.ints import uint32, uint64
# 1 stai coin = 1,000,000,000 = 1 billion mojo.
_mojo_per_staicoin = 1000000000
_blocks_per_year = 1681920 # 32 * 6 * 24 * 365
def calculate_pool_reward(height: uint32) -> uint64:
"""
Returns the pool reward at a certain block height. The pool earns 4/5 of the r... | 42.491228 | 116 | 0.67052 | from staicoin.util.ints import uint32, uint64
_mojo_per_staicoin = 1000000000
_blocks_per_year = 1681920
def calculate_pool_reward(height: uint32) -> uint64:
if height == 0:
return uint64(int((992 / 1000) * 55882000 * _mojo_per_staicoin))
elif height < 1 * _blocks_per_year:
return uint64(... | true | true |
f7213d02b27c785ef91695bcb230eaaa02989fb9 | 6,910 | py | Python | nova/objects/migrate_data.py | JohnGarbutt/nova | 21f6f7b63af920aa3a5501603c3debbcd5ec5bc5 | [
"Apache-2.0"
] | null | null | null | nova/objects/migrate_data.py | JohnGarbutt/nova | 21f6f7b63af920aa3a5501603c3debbcd5ec5bc5 | [
"Apache-2.0"
] | null | null | null | nova/objects/migrate_data.py | JohnGarbutt/nova | 21f6f7b63af920aa3a5501603c3debbcd5ec5bc5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.603352 | 78 | 0.639363 |
from oslo_log import log
from oslo_serialization import jsonutils
from nova import objects
from nova.objects import base as obj_base
from nova.objects import fields
LOG = log.getLogger(__name__)
@obj_base.NovaObjectRegistry.register_if(False)
class LiveMigrateData(obj_base.NovaObject):
fields = {... | true | true |
f72141757d175109c5dcb045ecabaf1763ea12c7 | 1,249 | py | Python | backend/verify/migrations/0001_initial.py | dabonthatbih/kkr-rest-api | e469183a99bd650c2ab979c4e420c3673b9ec049 | [
"Apache-2.0"
] | 1 | 2019-10-07T11:14:33.000Z | 2019-10-07T11:14:33.000Z | backend/verify/migrations/0001_initial.py | dabonthatbih/kkr-rest-api | e469183a99bd650c2ab979c4e420c3673b9ec049 | [
"Apache-2.0"
] | 15 | 2019-10-07T10:57:58.000Z | 2019-10-13T12:35:19.000Z | backend/verify/migrations/0001_initial.py | dabonthatbih/kkr-rest-api | e469183a99bd650c2ab979c4e420c3673b9ec049 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-06 13:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependen... | 37.848485 | 122 | 0.604484 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
oper... | true | true |
f7214236590167f0e9c078503c47ef27d6da679f | 19,636 | py | Python | tests/models/dsettlement/test_acceptance.py | Deltares/GEOLib | 73c3f325ba40a3e0c586e337541d491f4296f50c | [
"MIT"
] | 4 | 2021-10-29T21:30:47.000Z | 2022-03-18T13:15:17.000Z | tests/models/dsettlement/test_acceptance.py | Deltares/GEOLib | 73c3f325ba40a3e0c586e337541d491f4296f50c | [
"MIT"
] | 3 | 2021-11-05T07:56:16.000Z | 2022-03-27T13:27:05.000Z | tests/models/dsettlement/test_acceptance.py | Deltares/GEOLib | 73c3f325ba40a3e0c586e337541d491f4296f50c | [
"MIT"
] | 4 | 2021-10-29T21:30:51.000Z | 2022-01-17T13:20:40.000Z | import logging
import os
import pathlib
from datetime import timedelta
from pathlib import Path
from typing import List
from warnings import warn
import pydantic
import pytest
from pydantic.color import Color
from teamcity import is_running_under_teamcity
import geolib.models.dsettlement.loads as loads
import geolib.... | 30.443411 | 86 | 0.544052 | import logging
import os
import pathlib
from datetime import timedelta
from pathlib import Path
from typing import List
from warnings import warn
import pydantic
import pytest
from pydantic.color import Color
from teamcity import is_running_under_teamcity
import geolib.models.dsettlement.loads as loads
import geolib.... | true | true |
f7214283b1a050b951ccaeb5b99108ab85e04e6d | 48,023 | py | Python | authortitle/views.py | MLGB3/mysite | 433f245918cfc85f3d42b51e7405ae101160d3cd | [
"Apache-2.0"
] | null | null | null | authortitle/views.py | MLGB3/mysite | 433f245918cfc85f3d42b51e7405ae101160d3cd | [
"Apache-2.0"
] | null | null | null | authortitle/views.py | MLGB3/mysite | 433f245918cfc85f3d42b51e7405ae101160d3cd | [
"Apache-2.0"
] | null | null | null | """
# Setup script for index based on Richard Sharpe's List of Identifications
"""
#--------------------------------------------------------------------------------
import math
from django.template import Context, loader
from django.http import HttpResponse,Http404,HttpResponseRedirect
from djan... | 37.169505 | 106 | 0.596089 |
import math
from django.template import Context, loader
from django.http import HttpResponse,Http404,HttpResponseRedirect
from django.shortcuts import get_object_or_404, render_to_response
from django.core.urlresolvers import reverse
from django.utils.html import escape
from djan... | true | true |
f72142840be762476a0be5e21baec4a6ef055bf3 | 939 | py | Python | lists/models.py | danrneal/superlists | d8e956720429915eaee732020a2c51b884a3d143 | [
"MIT"
] | null | null | null | lists/models.py | danrneal/superlists | d8e956720429915eaee732020a2c51b884a3d143 | [
"MIT"
] | null | null | null | lists/models.py | danrneal/superlists | d8e956720429915eaee732020a2c51b884a3d143 | [
"MIT"
] | null | null | null | from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import models
class List(models.Model):
owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True)
shared_with = models.ManyToManyField(
settings.AUTH_USER_MODEL, related_name='shared_lists'
... | 26.083333 | 78 | 0.681576 | from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import models
class List(models.Model):
owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True)
shared_with = models.ManyToManyField(
settings.AUTH_USER_MODEL, related_name='shared_lists'
... | true | true |
f721429b03aedf2a6362c8a4270184f7d7d464c4 | 4,555 | py | Python | project/ionicv1/main.py | Bhanditz/JavaScriptEnhancements | f87ff0ae9dba99bab69bf4fe4e73ca29d198f81e | [
"MIT"
] | null | null | null | project/ionicv1/main.py | Bhanditz/JavaScriptEnhancements | f87ff0ae9dba99bab69bf4fe4e73ca29d198f81e | [
"MIT"
] | null | null | null | project/ionicv1/main.py | Bhanditz/JavaScriptEnhancements | f87ff0ae9dba99bab69bf4fe4e73ca29d198f81e | [
"MIT"
] | null | null | null | import sublime, sublime_plugin
import os, webbrowser, shlex, json, collections
def ionicv1_ask_custom_path(project_path, type):
sublime.active_window().show_input_panel("Ionic v1 CLI custom path", "ionic", lambda ionicv1_custom_path: ionicv1_prepare_project(project_path, ionicv1_custom_path) if type == "create_new... | 47.947368 | 304 | 0.730626 | import sublime, sublime_plugin
import os, webbrowser, shlex, json, collections
def ionicv1_ask_custom_path(project_path, type):
sublime.active_window().show_input_panel("Ionic v1 CLI custom path", "ionic", lambda ionicv1_custom_path: ionicv1_prepare_project(project_path, ionicv1_custom_path) if type == "create_new... | true | true |
f72142e5ac00cf950ce98fbca8180f0dd514c5e9 | 1,671 | py | Python | cn_proj/USocket.py | Carl-Rabbit/CS305-CN-Proj | d005c32674b7ce3f90e4099c536b3c914e133d7d | [
"Apache-2.0"
] | null | null | null | cn_proj/USocket.py | Carl-Rabbit/CS305-CN-Proj | d005c32674b7ce3f90e4099c536b3c914e133d7d | [
"Apache-2.0"
] | null | null | null | cn_proj/USocket.py | Carl-Rabbit/CS305-CN-Proj | d005c32674b7ce3f90e4099c536b3c914e133d7d | [
"Apache-2.0"
] | null | null | null | from socket import socket, AF_INET, SOCK_DGRAM, inet_aton, inet_ntoa
import time
sockets = {}
network = ('127.0.0.1', 12345)
def bytes_to_addr(bytes):
return inet_ntoa(bytes[:4]), int.from_bytes(bytes[4:8], 'big')
def addr_to_bytes(addr):
return inet_aton(addr[0]) + addr[1].to_bytes(4, 'big')
def get_sen... | 26.109375 | 75 | 0.618791 | from socket import socket, AF_INET, SOCK_DGRAM, inet_aton, inet_ntoa
import time
sockets = {}
network = ('127.0.0.1', 12345)
def bytes_to_addr(bytes):
return inet_ntoa(bytes[:4]), int.from_bytes(bytes[4:8], 'big')
def addr_to_bytes(addr):
return inet_aton(addr[0]) + addr[1].to_bytes(4, 'big')
def get_sen... | true | true |
f721433a67499332ba6e8d52379605bedd3d870c | 408 | py | Python | evan/services/mailer.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | null | null | null | evan/services/mailer.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | 20 | 2021-03-31T20:10:46.000Z | 2022-02-15T09:58:13.000Z | evan/services/mailer.py | eillarra/evan | befe0f8daedd1b1f629097110d92e68534e43da1 | [
"MIT"
] | null | null | null | from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
from typing import List
def send_email(
*, from_email: str = "Evan <evan@ugent.be>", to: List[str], subject: str, template: str, context_data: dict
):
text_content = render_to_string(template, context_data)... | 34 | 111 | 0.759804 | from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
from typing import List
def send_email(
*, from_email: str = "Evan <evan@ugent.be>", to: List[str], subject: str, template: str, context_data: dict
):
text_content = render_to_string(template, context_data)... | true | true |
f721457bba4d592a55104c5e37b8693bb3fe93c6 | 857 | py | Python | posts/migrations/0005_vote.py | MrRezoo/django-social-network | 253afed6f12ed5cb2c22066961ea3fa33727be20 | [
"MIT"
] | 1 | 2021-05-18T08:42:18.000Z | 2021-05-18T08:42:18.000Z | posts/migrations/0005_vote.py | MrRezoo/django-social-network | 253afed6f12ed5cb2c22066961ea3fa33727be20 | [
"MIT"
] | null | null | null | posts/migrations/0005_vote.py | MrRezoo/django-social-network | 253afed6f12ed5cb2c22066961ea3fa33727be20 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-05-19 19:52
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('posts', '0004_alter_comm... | 34.28 | 140 | 0.654609 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('posts', '0004_alter_comment_reply'),
]
operations = [
... | true | true |
f72145de142e44a5179e105ce79e68d8d169b232 | 7,927 | py | Python | test/functional/qtum_block_header.py | tongshiguanzi/O2O | c11983c922c83cdc97bd754d9f8a0d5a094f004f | [
"MIT"
] | 1 | 2020-07-22T08:45:28.000Z | 2020-07-22T08:45:28.000Z | test/functional/qtum_block_header.py | tongshiguanzi/O2O | c11983c922c83cdc97bd754d9f8a0d5a094f004f | [
"MIT"
] | null | null | null | test/functional/qtum_block_header.py | tongshiguanzi/O2O | c11983c922c83cdc97bd754d9f8a0d5a094f004f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from tes... | 44.284916 | 292 | 0.692444 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.blocktools import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.qtum import *
import time
from test_framework.key import ECKey
from test_framework.... | true | true |
f721490f7323d6f2e9dbcf3d61d3cb7972830a93 | 1,481 | py | Python | addons/destinations/create_cas_destination.py | paataugrekhelidze/model-management-resources | e3cc8719f349f9755690a4cf87f7e75574966e9c | [
"Apache-2.0"
] | 7 | 2020-02-21T02:43:07.000Z | 2021-04-13T15:09:37.000Z | addons/destinations/create_cas_destination.py | paataugrekhelidze/model-management-resources | e3cc8719f349f9755690a4cf87f7e75574966e9c | [
"Apache-2.0"
] | 11 | 2020-03-19T09:49:30.000Z | 2021-05-04T15:32:24.000Z | addons/destinations/create_cas_destination.py | paataugrekhelidze/model-management-resources | e3cc8719f349f9755690a4cf87f7e75574966e9c | [
"Apache-2.0"
] | 17 | 2020-02-17T23:42:37.000Z | 2021-06-16T12:24:49.000Z | # Copyright (c) 2020, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import sys
sys.path.append('..')
import mmAuthorization
import requests
import json
viya_host = "localhost"
port = ":8080"
host_url="http://" + viya_host + port
destination_url = host_url + "/modelPubl... | 27.943396 | 110 | 0.740041 |
import sys
sys.path.append('..')
import mmAuthorization
import requests
import json
viya_host = "localhost"
port = ":8080"
host_url="http://" + viya_host + port
destination_url = host_url + "/modelPublish/destinations/"
mm_auth = mmAuthorization.mmAuthorization("myAuth")
admin_userId = "<SAS_user_admin_ID>"
user... | true | true |
f7214984dd02b1bc0eae58d46c4bc02d9ce3fa79 | 4,206 | py | Python | thimbles/charts/radar_chart.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | thimbles/charts/radar_chart.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | thimbles/charts/radar_chart.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | """
http://matplotlib.org/examples/api/radar_chart.html
Example of creating a radar chart (a.k.a. a spider or star chart) [1]_.
Although this example allows a frame of either 'circle' or 'polygon', polygon
frames don't have proper gridlines (the lines are circles instead of polygons).
It's possible to get a polygon g... | 33.380952 | 79 | 0.622444 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.path import Path
from matplotlib.spines import Spine
from matplotlib.projections.polar import PolarAxes
from matplotlib.projections import register_projection
def radar_factory(num_vars, frame='circle'):
theta = 2*np.pi * np.linspace(0, 1-1.... | true | true |
f7214ba2fb5f78050521fcf3f80e3a68ce4d1155 | 1,826 | py | Python | smlb/feature_selection/feature_selector_sklearn.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 6 | 2020-07-27T21:08:55.000Z | 2021-05-04T07:00:29.000Z | smlb/feature_selection/feature_selector_sklearn.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 18 | 2020-09-01T00:47:04.000Z | 2021-09-15T22:16:56.000Z | smlb/feature_selection/feature_selector_sklearn.py | CitrineInformatics/smlb | 28a3689bd36aa8d51031b4faf7e2331bbd8148a9 | [
"Apache-2.0"
] | 2 | 2020-08-24T21:50:16.000Z | 2020-12-06T05:18:57.000Z | from smlb import (
params,
Data,
Features,
TabularData,
)
from smlb.feature_selection.selector_protocol_sklearn import SelectorProtocolSklearn
class FeatureSelectorSklearn(Features):
"""Base class for feature selection strategies that use one of scikit-learn's feature selection methods.
This ... | 28.984127 | 116 | 0.633078 | from smlb import (
params,
Data,
Features,
TabularData,
)
from smlb.feature_selection.selector_protocol_sklearn import SelectorProtocolSklearn
class FeatureSelectorSklearn(Features):
def __init__(self, selector: SelectorProtocolSklearn, *args, **kwargs):
super().__init__(*args, **kwargs)
... | true | true |
f7214d90b8586fc89f0cc957a7cf81ccb7d45c94 | 10,292 | py | Python | netket/sampler/metropolis_numpy.py | NetKet/netket | 96758e814fc3128e6821564d6cc2852bac40ecf2 | [
"Apache-2.0"
] | null | null | null | netket/sampler/metropolis_numpy.py | NetKet/netket | 96758e814fc3128e6821564d6cc2852bac40ecf2 | [
"Apache-2.0"
] | null | null | null | netket/sampler/metropolis_numpy.py | NetKet/netket | 96758e814fc3128e6821564d6cc2852bac40ecf2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 33.744262 | 95 | 0.643412 |
import math
from dataclasses import dataclass
from functools import partial
from typing import Any, Tuple, Callable
import numpy as np
from numba import jit
from jax import numpy as jnp
import jax
from netket.hilbert import AbstractHilbert
from netket.utils.mpi import mpi_sum, n_nodes
from netket.utils... | true | true |
f7214da5be355cbd7977e3d4b792fe2a9df91d2e | 393 | py | Python | LSTM/graphs/graph1.py | Anurag14/Inflow-prediction-Bhakra | d440ec552032084991878877ba5154ea2c452264 | [
"MIT"
] | 8 | 2019-05-29T09:07:25.000Z | 2021-12-28T13:53:50.000Z | LSTM/graphs/graph1.py | Anurag14/Inflow-prediction-Bhakra | d440ec552032084991878877ba5154ea2c452264 | [
"MIT"
] | null | null | null | LSTM/graphs/graph1.py | Anurag14/Inflow-prediction-Bhakra | d440ec552032084991878877ba5154ea2c452264 | [
"MIT"
] | 2 | 2019-06-02T17:48:48.000Z | 2022-03-13T01:29:16.000Z | import os
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_csv('../data1.csv')
df=df.values
#time series vs reservoir levels(ft) graph
sns.set_style('darkgrid')
plt.plot(df[:,0],df[:,1],label="")
plt.plot(df[:,0],df[:,2])
plt.xlabel('Time Series')
plt.ylabel('Reservoir Levels(ft)')
... | 24.5625 | 61 | 0.725191 | import os
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
df=pd.read_csv('../data1.csv')
df=df.values
sns.set_style('darkgrid')
plt.plot(df[:,0],df[:,1],label="")
plt.plot(df[:,0],df[:,2])
plt.xlabel('Time Series')
plt.ylabel('Reservoir Levels(ft)')
plt.title('Dialy Bhakhra Reservoir Levels ... | true | true |
f7214e4b71ef6b1633236cc12a531f99e4afc41e | 7,828 | py | Python | Python_Discord_Bot_JE/venv/Lib/site-packages/discord/asset.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | Python_Discord_Bot_JE/venv/Lib/site-packages/discord/asset.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | Python_Discord_Bot_JE/venv/Lib/site-packages/discord/asset.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2020 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the r... | 33.452991 | 99 | 0.605646 |
import io
from .errors import DiscordException
from .errors import InvalidArgument
from . import utils
VALID_STATIC_FORMATS = frozenset({"jpeg", "jpg", "webp", "png"})
VALID_AVATAR_FORMATS = VALID_STATIC_FORMATS | {"gif"}
class Asset:
__slots__ = ('_state', '_url')
BASE = 'https://cdn.discord... | true | true |
f7214e57978a52886d37352d317afc38f1a60349 | 3,932 | py | Python | tests/unit/dataactvalidator/test_c23_award_financial_1.py | chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend | 3de8cedf69d5a0c9fad8239734bd6291cf583936 | [
"CC0-1.0"
] | null | null | null | tests/unit/dataactvalidator/test_c23_award_financial_1.py | chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend | 3de8cedf69d5a0c9fad8239734bd6291cf583936 | [
"CC0-1.0"
] | null | null | null | tests/unit/dataactvalidator/test_c23_award_financial_1.py | chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend | 3de8cedf69d5a0c9fad8239734bd6291cf583936 | [
"CC0-1.0"
] | null | null | null | from random import choice
from string import ascii_uppercase, ascii_lowercase, digits
from tests.unit.dataactcore.factories.staging import AwardFinancialFactory, AwardProcurementFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'c23_award_financial_1'
def test_column_head... | 65.533333 | 164 | 0.739827 | from random import choice
from string import ascii_uppercase, ascii_lowercase, digits
from tests.unit.dataactcore.factories.staging import AwardFinancialFactory, AwardProcurementFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'c23_award_financial_1'
def test_column_head... | true | true |
f7214fd6196b206a0fc7264a73b8e0fd22653169 | 1,766 | py | Python | src/main-ja.py | junjihashimoto/wav2vec-2-nix | f104280586cf78d0fc5f280ea013f6bc676cd05e | [
"BSD-3-Clause"
] | null | null | null | src/main-ja.py | junjihashimoto/wav2vec-2-nix | f104280586cf78d0fc5f280ea013f6bc676cd05e | [
"BSD-3-Clause"
] | null | null | null | src/main-ja.py | junjihashimoto/wav2vec-2-nix | f104280586cf78d0fc5f280ea013f6bc676cd05e | [
"BSD-3-Clause"
] | null | null | null |
# https://huggingface.co/vumichien/wav2vec2-large-xlsr-japanese
import torch
import torchaudio
import librosa
from datasets import load_dataset
import MeCab
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
import re
# config
wakati = MeCab.Tagger("-Owakati")
chars_to_ignore_regex = '[\\\\\\\\\\\\\\\\\\\\\\... | 47.72973 | 325 | 0.64043 |
import torch
import torchaudio
import librosa
from datasets import load_dataset
import MeCab
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
import re
wakati = MeCab.Tagger("-Owakati")
chars_to_ignore_regex = '[\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\,\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\、\\\\\\\\\\\\\\\\\\\\\\\\\\\... | true | true |
f72150878c28e84523ea2167e57b4bc5ae34cb23 | 1,024 | py | Python | educative/TreesBFS/zigzagTraversal.py | j-dags/Algos | 8201171c983bf8464b1d25526a16493966eb426f | [
"MIT"
] | null | null | null | educative/TreesBFS/zigzagTraversal.py | j-dags/Algos | 8201171c983bf8464b1d25526a16493966eb426f | [
"MIT"
] | null | null | null | educative/TreesBFS/zigzagTraversal.py | j-dags/Algos | 8201171c983bf8464b1d25526a16493966eb426f | [
"MIT"
] | null | null | null | def zigzagTraversal(root):
queue = [root] # initialize queue to root node
result = []
while queue: # iterate through loop while queue is not empty
arr = []
# levelSize prevents us from looping pasts current level in queue
levelSize = len(queue)
for _ in range(levelSize):
# these two lines ... | 20.897959 | 69 | 0.636719 | def zigzagTraversal(root):
queue = [root]
result = []
while queue:
arr = []
levelSize = len(queue)
for _ in range(levelSize):
curr = queue[0]
queue = queue[1:]
if len(result) % 2 == 0: arr.append(curr.val)
else: arr = [curr.val] + arr
if cu... | true | true |
f7215088d8da5bd6c6c28282619051368571f5b9 | 1,260 | py | Python | fix_size.py | Dai-z/label-converters | 0da9bfa620c6ab222ed97b82c256401fcb5804cf | [
"MIT"
] | 1 | 2020-11-16T17:11:43.000Z | 2020-11-16T17:11:43.000Z | fix_size.py | Dai-z/label-converters | 0da9bfa620c6ab222ed97b82c256401fcb5804cf | [
"MIT"
] | null | null | null | fix_size.py | Dai-z/label-converters | 0da9bfa620c6ab222ed97b82c256401fcb5804cf | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
import os
from os import listdir, getcwd
from os.path import join
import argparse
import cv2
classes = []
def convert_annotation(image, args):
if args.anno_dir:
anno_file = join(args.anno_dir, image.split('.')[0]) + '.xml'
if not os.path.isfile(anno_file):
... | 28.636364 | 125 | 0.618254 | import xml.etree.ElementTree as ET
import os
from os import listdir, getcwd
from os.path import join
import argparse
import cv2
classes = []
def convert_annotation(image, args):
if args.anno_dir:
anno_file = join(args.anno_dir, image.split('.')[0]) + '.xml'
if not os.path.isfile(anno_file):
... | true | true |
f721509f3f35df7cb0d1888befa5bc53be9b4653 | 422 | py | Python | tmm/apps/translation_management_tool/migrations/0006_auto_20211105_1444.py | 2567910/tmm | c36bbb508ed8ea4fa8e814af817c5d4f4ae69d4c | [
"MIT"
] | 3 | 2022-03-02T19:30:26.000Z | 2022-03-04T10:55:10.000Z | tmm/apps/translation_management_tool/migrations/0006_auto_20211105_1444.py | 2567910/tmm | c36bbb508ed8ea4fa8e814af817c5d4f4ae69d4c | [
"MIT"
] | 3 | 2022-03-08T12:25:16.000Z | 2022-03-16T22:30:55.000Z | tmm/apps/translation_management_tool/migrations/0006_auto_20211105_1444.py | 2567910/tmm | c36bbb508ed8ea4fa8e814af817c5d4f4ae69d4c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-11-05 14:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('translation_management_tool', '0005_auto_20211105_1418'),
]
operations = [
migrations.AlterField(
model_name='language',
... | 22.210526 | 67 | 0.625592 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('translation_management_tool', '0005_auto_20211105_1418'),
]
operations = [
migrations.AlterField(
model_name='language',
name='languages',
field=models... | true | true |
f7215171b2591e8446240124dc5466d1022604c1 | 631 | py | Python | locations/items.py | wessport/allthecolleges | 7741ed0bef7359d6d871963c527a3d9e31303c7c | [
"MIT"
] | null | null | null | locations/items.py | wessport/allthecolleges | 7741ed0bef7359d6d871963c527a3d9e31303c7c | [
"MIT"
] | null | null | null | locations/items.py | wessport/allthecolleges | 7741ed0bef7359d6d871963c527a3d9e31303c7c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
# class AddressItem(scrapy.Item):
# # define the fields for your item here like:
# # name = scrapy.Field()
# pass
class AddressItem(scrapy... | 22.535714 | 52 | 0.652932 |
import scrapy
eld()
name = scrapy.Field()
street_address = scrapy.Field()
city = scrapy.Field()
state = scrapy.Field()
postcode = scrapy.Field()
ref = scrapy.Field()
website = scrapy.Field()
extras = scrapy.Field()
| true | true |
f72152194d185954a947a244a1109ed7161112ed | 26,894 | py | Python | tensorflow_estimator/contrib/estimator/python/estimator/rnn.py | CheukNgai/estimator | 673a50bd5ffa70d0672ce47e40f5075f1cbe0a62 | [
"Apache-2.0"
] | null | null | null | tensorflow_estimator/contrib/estimator/python/estimator/rnn.py | CheukNgai/estimator | 673a50bd5ffa70d0672ce47e40f5075f1cbe0a62 | [
"Apache-2.0"
] | null | null | null | tensorflow_estimator/contrib/estimator/python/estimator/rnn.py | CheukNgai/estimator | 673a50bd5ffa70d0672ce47e40f5075f1cbe0a62 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.696124 | 112 | 0.704618 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow_estimator.contrib.estimator.python.estimator import extenders
from tensorflow.contrib.feature_column.python.feature_column import sequence_feature_column as seq_fc
fro... | true | true |
f72153ee7a89b3a20eafa2cc82f8c626ef1eda68 | 688 | py | Python | uniseg/graphemeclustertest.py | olivier-compilatio/uniseg-python | 8513a59e9c701a173c8001655e592c18f8840b16 | [
"MIT"
] | 2 | 2019-12-28T09:28:43.000Z | 2021-05-11T02:01:47.000Z | uniseg/graphemeclustertest.py | olivier-compilatio/uniseg-python | 8513a59e9c701a173c8001655e592c18f8840b16 | [
"MIT"
] | null | null | null | uniseg/graphemeclustertest.py | olivier-compilatio/uniseg-python | 8513a59e9c701a173c8001655e592c18f8840b16 | [
"MIT"
] | 2 | 2019-07-23T09:11:55.000Z | 2019-10-02T17:13:53.000Z | #!/usr/bin/env python
from __future__ import (absolute_import,
division,
print_function,
unicode_literals)
import doctest
import unittest
from . import graphemecluster
from .db import iter_grapheme_cluster_break_tests
from .test import implement... | 22.933333 | 67 | 0.694767 |
from __future__ import (absolute_import,
division,
print_function,
unicode_literals)
import doctest
import unittest
from . import graphemecluster
from .db import iter_grapheme_cluster_break_tests
from .test import implement_break_tests
@imple... | true | true |
f721549c945034a707dcd61c8eb272e55a908d06 | 6,155 | py | Python | tests/pytest_extension/meta/test_all.py | broglep-work/python-pytest-cases | 4976c0073a2fad5fbe5de34a5d1199efda0b7da9 | [
"BSD-3-Clause"
] | 213 | 2018-07-05T21:21:21.000Z | 2022-03-22T04:54:53.000Z | tests/pytest_extension/meta/test_all.py | broglep-work/python-pytest-cases | 4976c0073a2fad5fbe5de34a5d1199efda0b7da9 | [
"BSD-3-Clause"
] | 259 | 2018-06-22T16:46:33.000Z | 2022-03-23T19:39:15.000Z | tests/pytest_extension/meta/test_all.py | broglep-work/python-pytest-cases | 4976c0073a2fad5fbe5de34a5d1199efda0b7da9 | [
"BSD-3-Clause"
] | 27 | 2019-03-26T12:46:49.000Z | 2022-02-21T16:56:23.000Z | import ast
import os
import shlex
import re
from os.path import join, dirname, isdir, exists
import pytest
from pytest_cases.common_mini_six import string_types
# Make the list of all tests that we will have to execute (each in an independent pytest runner)
THIS_DIR = dirname(__file__)
tests_raw_folder = join(THIS_D... | 36.420118 | 108 | 0.605199 | import ast
import os
import shlex
import re
from os.path import join, dirname, isdir, exists
import pytest
from pytest_cases.common_mini_six import string_types
THIS_DIR = dirname(__file__)
tests_raw_folder = join(THIS_DIR, 'raw')
test_files = [f for f in os.listdir(tests_raw_folder) if not f.startswith('_')]
MET... | true | true |
f72155b9712b48098172994163d1909c6bd06e2b | 959 | py | Python | django_mc2p/__init__.py | mc2p/mc2p-django | a8a245d0a2783a0199e74d2d0396c397c056f0f6 | [
"BSD-2-Clause"
] | null | null | null | django_mc2p/__init__.py | mc2p/mc2p-django | a8a245d0a2783a0199e74d2d0396c397c056f0f6 | [
"BSD-2-Clause"
] | null | null | null | django_mc2p/__init__.py | mc2p/mc2p-django | a8a245d0a2783a0199e74d2d0396c397c056f0f6 | [
"BSD-2-Clause"
] | null | null | null | from mc2p import MC2PClient as MC2PClientPython
__title__ = 'MyChoice2Pay Django'
__version__ = '0.1.3'
__author__ = 'MyChoice2Pay'
__license__ = 'BSD 2-Clause'
__copyright__ = 'Copyright 2017 MyChoice2Pay'
# Version synonym
VERSION = __version__
# Header encoding (see RFC5987)
HTTP_HEADER_ENCODING = 'iso-8859-1'
... | 23.975 | 67 | 0.665276 | from mc2p import MC2PClient as MC2PClientPython
__title__ = 'MyChoice2Pay Django'
__version__ = '0.1.3'
__author__ = 'MyChoice2Pay'
__license__ = 'BSD 2-Clause'
__copyright__ = 'Copyright 2017 MyChoice2Pay'
VERSION = __version__
HTTP_HEADER_ENCODING = 'iso-8859-1'
ISO_8601 = 'iso-8601'
default_app_config = 'dj... | true | true |
f721568c58cfd884ff05085466a0d5440678835f | 19,025 | py | Python | nnunet/inference/pretrained_models/download_pretrained_model.py | Jiawei-Yang/TumorCP | 6053c75642fcbc0fb0424320ab3d758f24883b0e | [
"Apache-2.0"
] | 12 | 2021-07-22T15:08:13.000Z | 2022-03-10T08:15:56.000Z | nnunet/inference/pretrained_models/download_pretrained_model.py | Jiawei-Yang/TumorCP | 6053c75642fcbc0fb0424320ab3d758f24883b0e | [
"Apache-2.0"
] | 1 | 2022-03-07T13:21:42.000Z | 2022-03-07T13:21:42.000Z | nnunet/inference/pretrained_models/download_pretrained_model.py | Jiawei-Yang/TumorCP | 6053c75642fcbc0fb0424320ab3d758f24883b0e | [
"Apache-2.0"
] | 3 | 2021-11-26T06:26:24.000Z | 2022-02-14T01:23:44.000Z | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 57.304217 | 191 | 0.595848 |
import zipfile
from time import time
import requests
from batchgenerators.utilities.file_and_folder_operations import join, isfile
from nnunet.paths import network_training_output_dir
def get_available_models():
available_models = {
"Task001_BrainTumour": {
'description': "Brain... | true | true |
f72157380ef02e33e2ef0f6f19e81eebfeeb2a1a | 5,318 | py | Python | optimizers/bohb_one_shot/plots/util.py | Mirofil/nasbench-1shot1 | 46637e259691ea2b1ab3b2f1cbbd309068f02cde | [
"Apache-2.0"
] | 65 | 2019-12-20T12:20:22.000Z | 2022-03-12T07:34:08.000Z | optimizers/bohb_one_shot/plots/util.py | crwhite14/nasbench-1shot1 | c34bf9c0222f07a30ba1518b3e52e120a3560aa4 | [
"Apache-2.0"
] | 8 | 2020-01-29T07:49:31.000Z | 2021-10-20T08:58:29.000Z | optimizers/bohb_one_shot/plots/util.py | crwhite14/nasbench-1shot1 | c34bf9c0222f07a30ba1518b3e52e120a3560aa4 | [
"Apache-2.0"
] | 18 | 2020-01-26T08:40:18.000Z | 2021-09-20T15:13:00.000Z | import os
import pickle
import collections
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from IPython import embed
colors={
'BOHB-PC-DARTS': 'darkorange',
'BOHB-DARTS': 'dodgerblue',
'BOHB-GDAS' : 'forestgreen',
'RE': 'crimson',
'RS': 'darkorchid',
'RL': ... | 33.446541 | 95 | 0.531403 | import os
import pickle
import collections
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from IPython import embed
colors={
'BOHB-PC-DARTS': 'darkorange',
'BOHB-DARTS': 'dodgerblue',
'BOHB-GDAS' : 'forestgreen',
'RE': 'crimson',
'RS': 'darkorchid',
'RL': ... | true | true |
f721587995d4a908abf3416954f163ffd9986c6f | 5,391 | py | Python | tools/PolicyAnalysis/Businesses.py | Randal1936/FinancialSupervision | 3d78b1cc662a2c0675ace880a772cc38eaf7672f | [
"MIT"
] | 1 | 2021-08-16T08:47:53.000Z | 2021-08-16T08:47:53.000Z | tools/PolicyAnalysis/Businesses.py | Randal1936/FSML | 3d78b1cc662a2c0675ace880a772cc38eaf7672f | [
"MIT"
] | 16 | 2021-08-02T14:34:52.000Z | 2021-08-04T12:48:06.000Z | tools/PolicyAnalysis/Businesses.py | Randal1936/FinancialSupervision | 3d78b1cc662a2c0675ace880a772cc38eaf7672f | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import xlwings as xw
from PolicyAnalysis import cptj as cj
"""
————————————————————
以下是使用 re 检索+ DFC 映射的数据处理写法
————————————————————
"""
class businesses_re:
def __init__(self, Data, userdict):
self.Data = Data
self.userdict = userdict
data = Data.co... | 34.120253 | 101 | 0.584122 | import pandas as pd
import numpy as np
import xlwings as xw
from PolicyAnalysis import cptj as cj
class businesses_re:
def __init__(self, Data, userdict):
self.Data = Data
self.userdict = userdict
data = Data.copy()
n = cj.txt_to_list(self.userdict)
... | true | true |
f7215945d58449184be2ce4c38342a88d9dfe3a5 | 1,847 | py | Python | accounts/migrations/0002_auto_20200522_2023.py | codertimeless/StudentAssociation | 3f6caf2b362623d4f8cf82bab9529951a375fe6a | [
"Apache-2.0"
] | null | null | null | accounts/migrations/0002_auto_20200522_2023.py | codertimeless/StudentAssociation | 3f6caf2b362623d4f8cf82bab9529951a375fe6a | [
"Apache-2.0"
] | 15 | 2020-03-09T11:56:13.000Z | 2022-02-10T15:03:01.000Z | accounts/migrations/0002_auto_20200522_2023.py | codertimeless/StudentAssociation | 3f6caf2b362623d4f8cf82bab9529951a375fe6a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.8 on 2020-05-22 20:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('management', '0001_initial'),
('accounts', '0001_initial'),
('auth', '0011_update_proxy_... | 41.977273 | 256 | 0.650785 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('management', '0001_initial'),
('accounts', '0001_initial'),
('auth', '0011_update_proxy_permissions'),
]
operations = [
... | true | true |
f72159a07dd981d68fbdfa405294da73b86fbb56 | 593 | py | Python | hashmaps/hash_map_tests.py | informramiz/data-structures-and-algorithms | 7038c8becc4cbad82867c9c8bca42637ca27c8d7 | [
"Apache-2.0"
] | null | null | null | hashmaps/hash_map_tests.py | informramiz/data-structures-and-algorithms | 7038c8becc4cbad82867c9c8bca42637ca27c8d7 | [
"Apache-2.0"
] | null | null | null | hashmaps/hash_map_tests.py | informramiz/data-structures-and-algorithms | 7038c8becc4cbad82867c9c8bca42637ca27c8d7 | [
"Apache-2.0"
] | 1 | 2020-09-24T22:54:52.000Z | 2020-09-24T22:54:52.000Z | from hash_map import HashMap
from asserts.asserts import assert_
def test_hash_map():
hash_map = HashMap(2)
# Test HashMap get and put
key = "abcde"
value = "ramiz"
hash_map.put(key, value)
output = hash_map.get(key)
assert_(value, output)
# Test size
assert_(1, hash_map.size())
... | 19.129032 | 35 | 0.637437 | from hash_map import HashMap
from asserts.asserts import assert_
def test_hash_map():
hash_map = HashMap(2)
key = "abcde"
value = "ramiz"
hash_map.put(key, value)
output = hash_map.get(key)
assert_(value, output)
assert_(1, hash_map.size())
hash_map.delete("abcde")
... | true | true |
f7215b16f3948f7d90fe03e4471250973c15ca0c | 639 | py | Python | davarocr/davarocr/davar_rcg/tools/__init__.py | icedream2/DAVAR-Lab-OCR | c8b82f45516850eeadcab2739fb2a4292f2fdca1 | [
"Apache-2.0"
] | 387 | 2021-01-02T07:50:15.000Z | 2022-03-31T04:30:03.000Z | davarocr/davarocr/davar_rcg/tools/__init__.py | icedream2/DAVAR-Lab-OCR | c8b82f45516850eeadcab2739fb2a4292f2fdca1 | [
"Apache-2.0"
] | 70 | 2021-05-04T18:28:18.000Z | 2022-03-31T14:14:52.000Z | davarocr/davarocr/davar_rcg/tools/__init__.py | icedream2/DAVAR-Lab-OCR | c8b82f45516850eeadcab2739fb2a4292f2fdca1 | [
"Apache-2.0"
] | 83 | 2021-01-05T08:28:26.000Z | 2022-03-31T07:14:03.000Z | """
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : __init__.py
# Abstract :
# Current Version: 1.0.0
# Date : 2021-05-01
###... | 31.95 | 98 | 0.450704 | from .test_utils import filter_punctuation, make_paths, show_result_table, results2json, eval_json
__all__ = [
"filter_punctuation",
"make_paths",
"show_result_table",
"results2json",
"eval_json"
]
| true | true |
f7215baa85a5f4afcd2f4643ea78bfc425bfefa5 | 2,586 | py | Python | app/back/settings/routes/api/__init__.py | jgphilpott/polyplot | c46861174ee5881dadffbfb2278d555462523547 | [
"MIT"
] | 5 | 2021-05-17T14:17:14.000Z | 2021-12-14T12:54:32.000Z | app/back/settings/routes/api/__init__.py | jgphilpott/iGraph | 2a91ba57e4950856a83d3a109753f8f2badee829 | [
"MIT"
] | 8 | 2020-02-09T02:48:41.000Z | 2021-05-16T04:57:02.000Z | app/back/settings/routes/api/__init__.py | jgphilpott/iGraph | 2a91ba57e4950856a83d3a109753f8f2badee829 | [
"MIT"
] | 2 | 2016-09-12T03:48:16.000Z | 2019-05-04T14:15:19.000Z | from front.tree.home.api.route import register_api_route
from front.tree.home.api.airports.route import register_api_airports_route
from front.tree.home.api.airports.airport.route import register_api_airport_route
from front.tree.home.api.cities.route import register_api_cities_route
from front.tree.home.api.cities.c... | 35.916667 | 87 | 0.842614 | from front.tree.home.api.route import register_api_route
from front.tree.home.api.airports.route import register_api_airports_route
from front.tree.home.api.airports.airport.route import register_api_airport_route
from front.tree.home.api.cities.route import register_api_cities_route
from front.tree.home.api.cities.c... | true | true |
f7215cee8919dee9ba60b53f2fdaa5fd496bb91f | 656 | py | Python | testing.py | vuthalab/spectrum-awg | 5edd7eb3b06f877bb6f77359773c9ba2d727c52d | [
"MIT"
] | 1 | 2022-02-28T15:38:57.000Z | 2022-02-28T15:38:57.000Z | testing.py | vuthalab/spectrum-awg | 5edd7eb3b06f877bb6f77359773c9ba2d727c52d | [
"MIT"
] | null | null | null | testing.py | vuthalab/spectrum-awg | 5edd7eb3b06f877bb6f77359773c9ba2d727c52d | [
"MIT"
] | null | null | null | import time
from M4i6622 import *
from Functions.functions import *
#4 functions to be used
def f0(x):
return sin(x)#sin_for_time(60000000, 40000000, 20000,10000, x)
def f1(x):
return sin(x)
def f2(x):
return sin(x,f=1000)
def f3(x):
return x
t0 = time.perf_counter()
... | 15.255814 | 78 | 0.637195 | import time
from M4i6622 import *
from Functions.functions import *
def f0(x):
return sin(x)
def f1(x):
return sin(x)
def f2(x):
return sin(x,f=1000)
def f3(x):
return x
t0 = time.perf_counter()
M4i = M4i6622(channelNum=3,sampleRate=625,clockOut=True,referenceClock=Fa... | true | true |
f7215cf985916a431b4772d83a2ecae8b5f0c458 | 4,513 | py | Python | experiments/exp_movie_5and7.py | Leaflowave/PrivCQ | 8acc6ad0888793fb7fa190a1bd5b4f9eb1140514 | [
"MIT"
] | null | null | null | experiments/exp_movie_5and7.py | Leaflowave/PrivCQ | 8acc6ad0888793fb7fa190a1bd5b4f9eb1140514 | [
"MIT"
] | null | null | null | experiments/exp_movie_5and7.py | Leaflowave/PrivCQ | 8acc6ad0888793fb7fa190a1bd5b4f9eb1140514 | [
"MIT"
] | null | null | null | import group_frequency_oracle as freq
import linecache
import random
def query_on_adult_dim2(oraclePath,oracleInterval,queryPath,trueOraclePath,aggregation="count"):
# adult_2 equal 5 and 7
queriesStr=linecache.getline(queryPath,1)
queries=eval(queriesStr)
answer=[0]*500
trueOracleStr=li... | 48.010638 | 114 | 0.534899 | import group_frequency_oracle as freq
import linecache
import random
def query_on_adult_dim2(oraclePath,oracleInterval,queryPath,trueOraclePath,aggregation="count"):
queriesStr=linecache.getline(queryPath,1)
queries=eval(queriesStr)
answer=[0]*500
trueOracleStr=linecache.getline(trueOrac... | true | true |
f7215e55cf136f7e2d8b5021a9fd804c6a6a0820 | 42,837 | py | Python | pytests/epengine/bucket_level_durability.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | pytests/epengine/bucket_level_durability.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | pytests/epengine/bucket_level_durability.py | cgghali/TAF | 1de8dec77ad781c373e18d9c285befd534ac203a | [
"Apache-2.0"
] | null | null | null | from copy import deepcopy
from random import sample, choice
from BucketLib.bucket import Bucket
from cb_tools.cb_cli import CbCli
from couchbase_helper.documentgenerator import doc_generator
from couchbase_helper.durability_helper import BucketDurability
from epengine.durability_base import BucketDurabilityBase
from e... | 44.855497 | 82 | 0.572682 | from copy import deepcopy
from random import sample, choice
from BucketLib.bucket import Bucket
from cb_tools.cb_cli import CbCli
from couchbase_helper.documentgenerator import doc_generator
from couchbase_helper.durability_helper import BucketDurability
from epengine.durability_base import BucketDurabilityBase
from e... | true | true |
f7215eaffbd11774be2c8286cbada91c47ac6b09 | 1,136 | py | Python | tools/getTask.py | Sh4der/adventofcode | 1823d7bac33778ef850e384d914843a0c0ded869 | [
"MIT"
] | null | null | null | tools/getTask.py | Sh4der/adventofcode | 1823d7bac33778ef850e384d914843a0c0ded869 | [
"MIT"
] | null | null | null | tools/getTask.py | Sh4der/adventofcode | 1823d7bac33778ef850e384d914843a0c0ded869 | [
"MIT"
] | null | null | null | import html2markdown as h2m
import urllib.request
import re
from sys import argv, exit
if __name__ == '__main__':
if len(argv) not in (2, 3): exit(1)
day = argv[1]
if int(day) not in range(1, 24):
exit(1)
destinationFilePath = argv[2]
url = "https://adventofcode.com/2020/day/" + day
r... | 28.4 | 96 | 0.626761 | import html2markdown as h2m
import urllib.request
import re
from sys import argv, exit
if __name__ == '__main__':
if len(argv) not in (2, 3): exit(1)
day = argv[1]
if int(day) not in range(1, 24):
exit(1)
destinationFilePath = argv[2]
url = "https://adventofcode.com/2020/day/" + day
r... | true | true |
f7215eeae590fcac6dd15874392f9bd3361b29e0 | 1,294 | py | Python | wikum-env3/lib/python3.7/site-packages/sumy/models/dom/_sentence.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | null | null | null | wikum-env3/lib/python3.7/site-packages/sumy/models/dom/_sentence.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | null | null | null | wikum-env3/lib/python3.7/site-packages/sumy/models/dom/_sentence.py | xuericlin/wikum | f0171f1697efa91d6957f976f473c9201db85648 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from ...utils import cached_property
from ..._compat import to_unicode, to_string, unicode_compatible
@unicode_compatible
class Sentence(object):
__slots__ = ("_text", "_ca... | 28.755556 | 89 | 0.651468 |
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from ...utils import cached_property
from ..._compat import to_unicode, to_string, unicode_compatible
@unicode_compatible
class Sentence(object):
__slots__ = ("_text", "_cached_property_words", "_... | true | true |
f7216012bdabcc6a4f76ac1521c5236c58f42c7a | 393 | py | Python | bookitoBackend/User/urls.py | mazdakdev/Bookito | 38e18fee22aafea95429da01e9769acf2748f676 | [
"MIT"
] | 10 | 2021-12-09T04:39:03.000Z | 2022-02-07T05:42:29.000Z | bookitoBackend/User/urls.py | mazdakdev/Bookito | 38e18fee22aafea95429da01e9769acf2748f676 | [
"MIT"
] | 2 | 2022-02-07T18:12:54.000Z | 2022-02-10T10:27:37.000Z | bookitoBackend/User/urls.py | mazdakdev/Bookito | 38e18fee22aafea95429da01e9769acf2748f676 | [
"MIT"
] | null | null | null | from django.urls import path
from .api import *
from knox import views as knox_views
urlpatterns = [
#domain.dn/api/v1/register/ | POST
path('register/' , SignUpAPI.as_view() , name='register'),
#domain.dn/api/v1/register/ | POST
path('login/' , SignInAPI.as_view() , name='login'),
#domain.dn/ap... | 21.833333 | 62 | 0.64631 | from django.urls import path
from .api import *
from knox import views as knox_views
urlpatterns = [
path('register/' , SignUpAPI.as_view() , name='register'),
path('login/' , SignInAPI.as_view() , name='login'),
path('user/', MainUser.as_view() , name='user'),
] | true | true |
f7216046bb8fc44df661da3c65b4c665932b2bf6 | 1,845 | py | Python | gdsfactory/simulation/simphony/components/ring_double_siepic.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | gdsfactory/simulation/simphony/components/ring_double_siepic.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | gdsfactory/simulation/simphony/components/ring_double_siepic.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | from simphony.library import siepic
from simphony.netlist import Subcircuit
def ring_double_siepic(
wg_width=0.5,
gap=0.2,
length_x=4,
bend_radius=5,
length_y=2,
coupler=siepic.ebeam_dc_halfring_straight,
straight=siepic.ebeam_wg_integral_1550,
terminator=siepic.ebeam_terminator_te1550... | 25.273973 | 87 | 0.539837 | from simphony.library import siepic
from simphony.netlist import Subcircuit
def ring_double_siepic(
wg_width=0.5,
gap=0.2,
length_x=4,
bend_radius=5,
length_y=2,
coupler=siepic.ebeam_dc_halfring_straight,
straight=siepic.ebeam_wg_integral_1550,
terminator=siepic.ebeam_terminator_te1550... | true | true |
f72160586c3494b35606c754418a7f75fc368e1d | 10,517 | py | Python | pytorch/data.py | layumi/dgcnn | a7b58796ffe549f2d8bdb06a84f62aba03e1d3a1 | [
"MIT"
] | null | null | null | pytorch/data.py | layumi/dgcnn | a7b58796ffe549f2d8bdb06a84f62aba03e1d3a1 | [
"MIT"
] | null | null | null | pytorch/data.py | layumi/dgcnn | a7b58796ffe549f2d8bdb06a84f62aba03e1d3a1 | [
"MIT"
] | 1 | 2021-01-15T10:04:33.000Z | 2021-01-15T10:04:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: Yue Wang
@Contact: yuewangx@mit.edu
@File: data.py
@Time: 2018/10/13 6:21 PM
Modified by
@Author: An Tao
@Contact: ta19@mails.tsinghua.edu.cn
@Time: 2020/2/27 9:32 PM
"""
import os
import sys
import glob
import h5py
import numpy as np
import torch
from torc... | 37.03169 | 105 | 0.629837 |
import os
import sys
import glob
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
def download_modelnet40():
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_DIR = os.path.join(BASE_DIR, 'data')
if not os.path.exists(DATA_DIR):
os.mkdir(DATA_DIR)
i... | true | true |
f721616e2e38048326fa72960040fcebc5347540 | 1,016 | py | Python | packages/syft/tests/syft/lib/sklearn/model_serialize_test.py | wip-abramson/PySyft | c321b26ce1aa3c969793874e663a8a46b1228dd1 | [
"Apache-1.1"
] | 1 | 2021-08-31T11:37:19.000Z | 2021-08-31T11:37:19.000Z | packages/syft/tests/syft/lib/sklearn/model_serialize_test.py | karapto/PySyft | 2940bfebb3e0f37a1b7451cf9581c41917534ed6 | [
"Apache-1.1"
] | null | null | null | packages/syft/tests/syft/lib/sklearn/model_serialize_test.py | karapto/PySyft | 2940bfebb3e0f37a1b7451cf9581c41917534ed6 | [
"Apache-1.1"
] | null | null | null | # third party
import numpy as np
import pytest
from sklearn.linear_model import LogisticRegression
# syft absolute
import syft as sy
from syft.experimental_flags import flags
sy.load("sklearn")
sy.load("numpy")
@pytest.mark.vendor(lib="sklearn")
@pytest.mark.parametrize("arrow_backend", [True, False])
def test_logi... | 26.736842 | 61 | 0.649606 |
import numpy as np
import pytest
from sklearn.linear_model import LogisticRegression
import syft as sy
from syft.experimental_flags import flags
sy.load("sklearn")
sy.load("numpy")
@pytest.mark.vendor(lib="sklearn")
@pytest.mark.parametrize("arrow_backend", [True, False])
def test_logistic_model_serde(
arrow_... | true | true |
f72161c03ab784a2ce4d00015d797e74b8a25925 | 2,042 | py | Python | SecuriTree/views.py | davymaish/django-SecuriTree | 01cf925e591877ae2669ca8430845abe278832bf | [
"BSD-2-Clause"
] | null | null | null | SecuriTree/views.py | davymaish/django-SecuriTree | 01cf925e591877ae2669ca8430845abe278832bf | [
"BSD-2-Clause"
] | null | null | null | SecuriTree/views.py | davymaish/django-SecuriTree | 01cf925e591877ae2669ca8430845abe278832bf | [
"BSD-2-Clause"
] | null | null | null | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.template import loader
from django.contrib import messages
from django.views import generic
from django.views.generic.base import TemplateView
from django.utils i... | 27.972603 | 75 | 0.731636 | from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.template import loader
from django.contrib import messages
from django.views import generic
from django.views.generic.base import TemplateView
from django.utils i... | true | true |
f721628ea6b0b18873ff1f9593f52a8c6a6f14af | 6,273 | py | Python | thenewboston_node/business_logic/tests/test_file_blockchain/test_primary_validator.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/tests/test_file_blockchain/test_primary_validator.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | thenewboston_node/business_logic/tests/test_file_blockchain/test_primary_validator.py | andbortnik/thenewboston-node | bd63c7def5f224286dba70f9560252a7da8ea712 | [
"MIT"
] | null | null | null | from thenewboston_node.business_logic.blockchain.file_blockchain import FileBlockchain
from thenewboston_node.business_logic.models import (
AccountState, Block, Node, NodeDeclarationSignedChangeRequest, PrimaryValidatorSchedule,
PrimaryValidatorScheduleSignedChangeRequest
)
from thenewboston_node.business_logi... | 46.466667 | 108 | 0.809501 | from thenewboston_node.business_logic.blockchain.file_blockchain import FileBlockchain
from thenewboston_node.business_logic.models import (
AccountState, Block, Node, NodeDeclarationSignedChangeRequest, PrimaryValidatorSchedule,
PrimaryValidatorScheduleSignedChangeRequest
)
from thenewboston_node.business_logi... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.