hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3efe56717d90a8d09328f57a5bc578273d39ac | 9,089 | py | Python | vpc-flow-logs/enable-vpc-flowlogs.py | adamgilman/aws-fast-fixes | ace2ee78f19ea9555d4e2314c049a0df741b406a | [
"Apache-2.0"
] | null | null | null | vpc-flow-logs/enable-vpc-flowlogs.py | adamgilman/aws-fast-fixes | ace2ee78f19ea9555d4e2314c049a0df741b406a | [
"Apache-2.0"
] | null | null | null | vpc-flow-logs/enable-vpc-flowlogs.py | adamgilman/aws-fast-fixes | ace2ee78f19ea9555d4e2314c049a0df741b406a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import boto3
from botocore.exceptions import ClientError
import logging
def main(args, logger):
'''Executes the Primary Logic'''
# If they specify a profile use it. Otherwise do the normal thing
if args.profile:
session = boto3.Session(profile_name=args.profile)
else:
... | 40.395556 | 154 | 0.601276 |
import boto3
from botocore.exceptions import ClientError
import logging
def main(args, logger):
if args.profile:
session = boto3.Session(profile_name=args.profile)
else:
session = boto3.Session()
all_regions = get_regions(session, args)
for region in all_regions:
... | true | true |
1c3efe5ec2a1831555eaf795850e6be08dadf58f | 844 | bzl | Python | build/go_binary.bzl | xybots/cert-manager | cdccb752ff98219a1995fce2c6f797c450437805 | [
"Apache-2.0"
] | 1 | 2021-04-01T04:14:36.000Z | 2021-04-01T04:14:36.000Z | build/go_binary.bzl | xybots/cert-manager | cdccb752ff98219a1995fce2c6f797c450437805 | [
"Apache-2.0"
] | 1 | 2021-02-24T00:42:10.000Z | 2021-02-24T00:42:10.000Z | build/go_binary.bzl | xybots/cert-manager | cdccb752ff98219a1995fce2c6f797c450437805 | [
"Apache-2.0"
] | 3 | 2020-06-17T19:04:26.000Z | 2021-02-11T14:29:09.000Z | # Copyright 2020 The Jetstack cert-manager contributors.
#
# 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 l... | 35.166667 | 74 | 0.726303 |
load(":version.bzl", "version_x_defs")
load("@io_bazel_rules_go//go:def.bzl", real_go_binary = "go_binary")
def go_binary(name, **kwargs):
real_go_binary(
name = name,
x_defs = version_x_defs(),
**kwargs,
)
| true | true |
1c3efe945ce0be96d2fe3fb29a37f0bac9cd0d9d | 6,302 | py | Python | idm_lp/database/database.py | hfek/hfek | ecafcd177bf5a4af1f499180a2230985bd953863 | [
"MIT"
] | null | null | null | idm_lp/database/database.py | hfek/hfek | ecafcd177bf5a4af1f499180a2230985bd953863 | [
"MIT"
] | null | null | null | idm_lp/database/database.py | hfek/hfek | ecafcd177bf5a4af1f499180a2230985bd953863 | [
"MIT"
] | null | null | null | import asyncio
import json
import os
import typing
from typing import List
from pydantic import BaseModel, validator, Field
from idm_lp import const
from . import (
Alias,
ChatEnterModel,
IgnoredMembers,
IgnoredGlobalMembers,
MutedMembers,
ContextInstanceMixin,
RegexDeleter,
RolePlayCo... | 39.142857 | 110 | 0.643923 | import asyncio
import json
import os
import typing
from typing import List
from pydantic import BaseModel, validator, Field
from idm_lp import const
from . import (
Alias,
ChatEnterModel,
IgnoredMembers,
IgnoredGlobalMembers,
MutedMembers,
ContextInstanceMixin,
RegexDeleter,
RolePlayCo... | true | true |
1c3efe98da4095058df9a4d3135d99eecccd4a74 | 575 | py | Python | config/celery_app.py | Dm1tryD/estore_api | 1b944d2c3c47303e312581c3fc1a8af658eb3d06 | [
"MIT"
] | null | null | null | config/celery_app.py | Dm1tryD/estore_api | 1b944d2c3c47303e312581c3fc1a8af658eb3d06 | [
"MIT"
] | null | null | null | config/celery_app.py | Dm1tryD/estore_api | 1b944d2c3c47303e312581c3fc1a8af658eb3d06 | [
"MIT"
] | null | null | null | import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
app = Celery("estore_api")
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
#... | 31.944444 | 72 | 0.782609 | import os
from celery import Celery
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
app = Celery("estore_api")
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
app.config_from_object("django... | true | true |
1c3efea36189ce256d13e4e745168bf3a12a3f29 | 779 | py | Python | Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py | rishabhCMS/cmssw | 77d83fe564dd8f598d0bb09da8388445d6f4126e | [
"Apache-2.0"
] | 1 | 2020-10-08T06:48:26.000Z | 2020-10-08T06:48:26.000Z | Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py | rishabhCMS/cmssw | 77d83fe564dd8f598d0bb09da8388445d6f4126e | [
"Apache-2.0"
] | null | null | null | Validation/CTPPS/python/simu_config/year_2018_postTS2_cff.py | rishabhCMS/cmssw | 77d83fe564dd8f598d0bb09da8388445d6f4126e | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
from Validation.CTPPS.simu_config.year_2018_cff import *
# alignment
from CalibPPS.ESProducers.ctppsRPAlignmentCorrectionsDataESSourceXML_cfi import *
alignmentFile = "Validation/CTPPS/alignment/2018_postTS2.xml"
ctppsRPAlignmentCorrectionsDataESSourceXML.MisalignedFiles = [al... | 43.277778 | 131 | 0.802311 | import FWCore.ParameterSet.Config as cms
from Validation.CTPPS.simu_config.year_2018_cff import *
from CalibPPS.ESProducers.ctppsRPAlignmentCorrectionsDataESSourceXML_cfi import *
alignmentFile = "Validation/CTPPS/alignment/2018_postTS2.xml"
ctppsRPAlignmentCorrectionsDataESSourceXML.MisalignedFiles = [alignmentFile]... | true | true |
1c3f000beb71bb40696ed111f073504de119b2eb | 12,313 | py | Python | assignment3/cs231n/classifiers/rnn.py | kandluis/cs231n | 88afdbc37189f54803f361b9812f48843357349e | [
"MIT"
] | null | null | null | assignment3/cs231n/classifiers/rnn.py | kandluis/cs231n | 88afdbc37189f54803f361b9812f48843357349e | [
"MIT"
] | null | null | null | assignment3/cs231n/classifiers/rnn.py | kandluis/cs231n | 88afdbc37189f54803f361b9812f48843357349e | [
"MIT"
] | null | null | null | from builtins import range
from builtins import object
import numpy as np
from cs231n.layers import *
from cs231n.rnn_layers import *
class CaptioningRNN(object):
"""
A CaptioningRNN produces captions from image features using a recurrent
neural network.
The RNN receives input vectors of size D, has... | 51.304167 | 84 | 0.56282 | from builtins import range
from builtins import object
import numpy as np
from cs231n.layers import *
from cs231n.rnn_layers import *
class CaptioningRNN(object):
def __init__(self, word_to_idx, input_dim=512, wordvec_dim=128,
hidden_dim=128, cell_type='rnn', dtype=np.float32):
if cell_... | true | true |
1c3f01950869cfecf6380046a2eb24ec7d0d2cea | 6,929 | py | Python | research/delf/delf/python/feature_io.py | hamediramin/ObjectDetectionAPI | 38638ce126ab708b1eb22a3cf40d4c7713cc535f | [
"Apache-2.0"
] | 3,326 | 2018-01-26T22:42:25.000Z | 2022-02-16T13:16:39.000Z | research/delf/delf/python/feature_io.py | lianlengyunyu/models | 984fbc754943c849c55a57923f4223099a1ff88c | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | research/delf/delf/python/feature_io.py | lianlengyunyu/models | 984fbc754943c849c55a57923f4223099a1ff88c | [
"Apache-2.0"
] | 1,474 | 2018-02-01T04:33:18.000Z | 2022-03-08T07:02:20.000Z | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.994949 | 80 | 0.693895 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from delf import feature_pb2
from delf import datum_io
import numpy as np
from six.moves import xrange
import tensorflow as tf
def ArraysToDelfFeatures(locations,
scales,
... | true | true |
1c3f0197b9aad6e08ff29278749e9495d7b8f1f4 | 846 | py | Python | apis/alembic/versions/d10a9ad9f863_add_restart_number_for_deploy_.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 4 | 2021-07-15T15:59:01.000Z | 2022-02-24T02:58:52.000Z | apis/alembic/versions/d10a9ad9f863_add_restart_number_for_deploy_.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 4 | 2020-06-12T04:05:46.000Z | 2021-11-09T03:53:13.000Z | apis/alembic/versions/d10a9ad9f863_add_restart_number_for_deploy_.py | iii-org/devops-system | 71f938c9e225ac24ab9102a8221dc5341a01889c | [
"Apache-2.0"
] | 2 | 2020-09-29T05:39:28.000Z | 2021-11-26T09:52:17.000Z | """add restart number for deploy application
Revision ID: d10a9ad9f863
Revises: 90a8f40d4f2c
Create Date: 2021-09-06 10:33:18.670376
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd10a9ad9f863'
down_revision = '90a8f40d4f2c'
branch_labels = None
depends_on = ... | 27.290323 | 90 | 0.710402 | from alembic import op
import sqlalchemy as sa
revision = 'd10a9ad9f863'
down_revision = '90a8f40d4f2c'
branch_labels = None
depends_on = None
def upgrade():
op.add_column('application', sa.Column('restart_number', sa.Integer(), nullable=True))
op.add_column('application', sa.Column('restarted_at', sa.D... | true | true |
1c3f024bb5c2bb49fd2bbfa7cfe9f781f205d339 | 47,928 | py | Python | Algorithm.Python/PL_Stat6_fx/hp3.py | pasztorlacos/Lean | ca204c07d9bb390f853eb2f3da0ebc08150fef36 | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/PL_Stat6_fx/hp3.py | pasztorlacos/Lean | ca204c07d9bb390f853eb2f3da0ebc08150fef36 | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/PL_Stat6_fx/hp3.py | pasztorlacos/Lean | ca204c07d9bb390f853eb2f3da0ebc08150fef36 | [
"Apache-2.0"
] | null | null | null | ### <summary>
### Helpers
###
### </summary>
from QuantConnect.Orders import *
from QuantConnect.Orders.Fills import *
from QuantConnect.Orders.Fees import *
import tensorflow as tf
from QuantConnect.Orders import OrderStatus
from QuantConnect import Resolution, SecurityType
#import math
from math import log
#import ... | 60.899619 | 2,637 | 0.571378 | from QuantConnect.Orders import *
from QuantConnect.Orders.Fills import *
from QuantConnect.Orders.Fees import *
import tensorflow as tf
from QuantConnect.Orders import OrderStatus
from QuantConnect import Resolution, SecurityType
from math import log
import pandas as pd
import numpy as np
from datetime import datetim... | true | true |
1c3f02f8e5985d6b7670531f93bdfb106a93f89f | 2,070 | py | Python | dataloader.py | JayD1912/image_outpaint | 0b47d94c6cbd10f749ed717d7d5f76bba03c0d9d | [
"MIT"
] | null | null | null | dataloader.py | JayD1912/image_outpaint | 0b47d94c6cbd10f749ed717d7d5f76bba03c0d9d | [
"MIT"
] | null | null | null | dataloader.py | JayD1912/image_outpaint | 0b47d94c6cbd10f749ed717d7d5f76bba03c0d9d | [
"MIT"
] | null | null | null | import numpy as np
import os
from random import shuffle
DATA_PATH = "train"
TEST_PATH = "test"
class Data():
def __init__(self):
self.X_counter = 0
self.file_counter = 0
self.files = os.listdir(DATA_PATH)
self.files = [file for file in self.files if '.npy' in file]
shuffle(self.files)
s... | 24.069767 | 74 | 0.644928 | import numpy as np
import os
from random import shuffle
DATA_PATH = "train"
TEST_PATH = "test"
class Data():
def __init__(self):
self.X_counter = 0
self.file_counter = 0
self.files = os.listdir(DATA_PATH)
self.files = [file for file in self.files if '.npy' in file]
shuffle(self.files)
s... | true | true |
1c3f04dfed6c101a659c0d01e90716a188f78071 | 4,533 | py | Python | sourcecode/usb-example/python/face_detect.py | HeavenFish/Face-Recognition-Check-in-with-Line-API | 06f5fb635ce606f225ef24aac8270d689dd68cbc | [
"MIT"
] | null | null | null | sourcecode/usb-example/python/face_detect.py | HeavenFish/Face-Recognition-Check-in-with-Line-API | 06f5fb635ce606f225ef24aac8270d689dd68cbc | [
"MIT"
] | null | null | null | sourcecode/usb-example/python/face_detect.py | HeavenFish/Face-Recognition-Check-in-with-Line-API | 06f5fb635ce606f225ef24aac8270d689dd68cbc | [
"MIT"
] | null | null | null | import time
import cv2 as cv
import smtplib as sm
import os
from practicum import find_mcu_boards, McuBoard, PeriBoard
from requests import get, post
from line_notify import LineNotify
def notifymessage(message):
payload = {"message": message}
sendnotify(payload)
def notifypic(message, url):
... | 35.414063 | 116 | 0.554379 | import time
import cv2 as cv
import smtplib as sm
import os
from practicum import find_mcu_boards, McuBoard, PeriBoard
from requests import get, post
from line_notify import LineNotify
def notifymessage(message):
payload = {"message": message}
sendnotify(payload)
def notifypic(message, url):
... | true | true |
1c3f056eef1798da8fcdf25ae23b87f8e864b8e9 | 2,616 | py | Python | src/scheduler/domain/operation/commands/SendSchedulerErrorMailCommand.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | null | null | null | src/scheduler/domain/operation/commands/SendSchedulerErrorMailCommand.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | null | null | null | src/scheduler/domain/operation/commands/SendSchedulerErrorMailCommand.py | jedicontributors/pythondataintegrator | 3e877b367ab9b20185476128ec053db41087879f | [
"MIT"
] | null | null | null | from injector import inject
from IocManager import IocManager
from infrastructor.configuration.ConfigService import ConfigService
from infrastructor.data.RepositoryProvider import RepositoryProvider
from infrastructor.delivery.EmailProvider import EmailProvider
from infrastructor.exceptions.OperationalException import... | 51.294118 | 116 | 0.713303 | from injector import inject
from IocManager import IocManager
from infrastructor.configuration.ConfigService import ConfigService
from infrastructor.data.RepositoryProvider import RepositoryProvider
from infrastructor.delivery.EmailProvider import EmailProvider
from infrastructor.exceptions.OperationalException import... | true | true |
1c3f06668e685207312debef13aeb5f3ad782b94 | 437 | py | Python | rubicon_ml/ui/__init__.py | capitalone/rubicon | b784cd2e28c68bc44d04317b7acc1eaadda7e4eb | [
"Apache-2.0"
] | 42 | 2021-02-23T23:30:49.000Z | 2021-05-01T02:54:03.000Z | rubicon_ml/ui/__init__.py | capitalone/rubicon-ml | b784cd2e28c68bc44d04317b7acc1eaadda7e4eb | [
"Apache-2.0"
] | 56 | 2021-05-13T13:47:50.000Z | 2022-03-24T13:46:49.000Z | rubicon_ml/ui/__init__.py | capitalone/rubicon | b784cd2e28c68bc44d04317b7acc1eaadda7e4eb | [
"Apache-2.0"
] | 9 | 2021-02-23T23:30:51.000Z | 2021-04-24T16:42:28.000Z | def _check_for_ui_extras():
try:
import dash # noqa F401
import dash_html_components as html # noqa F401
except ImportError:
install_command = "pip install rubicon[ui]"
message = f"Install the packages required for the UI with `{install_command}`."
raise ImportError(me... | 25.705882 | 87 | 0.693364 | def _check_for_ui_extras():
try:
import dash import dash_html_components as html except ImportError:
install_command = "pip install rubicon[ui]"
message = f"Install the packages required for the UI with `{install_command}`."
raise ImportError(message)
_check_for_ui_e... | true | true |
1c3f08346d19b97e95a22306a1f67375c392273a | 227 | py | Python | sequential/audioset/__init__.py | mariacer/cl_in_rnns | 333b8e03391600a8e3df7d684a3f171b135d273a | [
"Apache-2.0"
] | 26 | 2020-06-17T08:44:15.000Z | 2022-03-20T04:21:13.000Z | sequential/audioset/__init__.py | mariacer/cl_in_rnns | 333b8e03391600a8e3df7d684a3f171b135d273a | [
"Apache-2.0"
] | null | null | null | sequential/audioset/__init__.py | mariacer/cl_in_rnns | 333b8e03391600a8e3df7d684a3f171b135d273a | [
"Apache-2.0"
] | 4 | 2020-10-26T02:19:38.000Z | 2021-12-26T02:26:05.000Z | import os
import sys
curr_dir = os.path.basename(os.path.abspath(os.curdir))
# See __init__.py in folder "toy_example" for an explanation.
if curr_dir == 'audioset' and '../..' not in sys.path:
sys.path.insert(0, '../..')
| 28.375 | 61 | 0.682819 | import os
import sys
curr_dir = os.path.basename(os.path.abspath(os.curdir))
if curr_dir == 'audioset' and '../..' not in sys.path:
sys.path.insert(0, '../..')
| true | true |
1c3f0914bb047b56ded0096975ff401e24cd96e5 | 7,279 | py | Python | lte/gateway/python/magma/pipelined/rule_mappers.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/pipelined/rule_mappers.py | saurabhsoni88/magma | 4236c9d8edb7bd203707ff7e861b1f7c12fb84c7 | [
"BSD-3-Clause"
] | 72 | 2021-03-08T09:37:52.000Z | 2022-03-29T23:20:10.000Z | lte/gateway/python/magma/pipelined/rule_mappers.py | kkahrs/magma | 73e666627dc28e0c492feab7321bb7d6dd433b09 | [
"BSD-3-Clause"
] | 1 | 2021-07-07T14:26:13.000Z | 2021-07-07T14:26:13.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 34.334906 | 84 | 0.660393 | import json
import threading
from collections import namedtuple
from typing import Optional
from lte.protos.mobilityd_pb2 import IPAddress
from magma.pipelined.imsi import encode_imsi
from magma.common.redis.client import get_default_client
from magma.common.redis.containers import RedisHashDict
from magma.common.redi... | true | true |
1c3f0a0c86d47e00c83a25b03533a6f7098b15d8 | 927 | py | Python | etc/v3/lib.py | timm/au | 14b6ae77cf12c746c1dbad3d35a3dca874fc8d41 | [
"MIT"
] | null | null | null | etc/v3/lib.py | timm/au | 14b6ae77cf12c746c1dbad3d35a3dca874fc8d41 | [
"MIT"
] | 14 | 2020-05-24T19:22:20.000Z | 2021-01-01T03:50:26.000Z | etc/v3/lib.py | timm/gold | 14b6ae77cf12c746c1dbad3d35a3dca874fc8d41 | [
"MIT"
] | null | null | null | import pprint
import re
import random
import sys
class Thing:
"Classes that can pretty print themselves."
def __repr__(i):
return re.sub(r"'", ' ',
pprint.pformat(dicts(i.__dict__), compact=True))
def dicts(i, seen=None):
" Converts `i` into a nested dictionary, then pretty-prints that."... | 22.609756 | 68 | 0.606257 | import pprint
import re
import random
import sys
class Thing:
def __repr__(i):
return re.sub(r"'", ' ',
pprint.pformat(dicts(i.__dict__), compact=True))
def dicts(i, seen=None):
if isinstance(i, (tuple, list)):
return [dicts(v, seen) for v in i]
elif isinstance(i, dict):
return {... | true | true |
1c3f0a791361f1bf2f0d720fe7fdd421e3085d21 | 283 | py | Python | compiler_gym/util/flags/episode_length.py | thecoblack/CompilerGym | ade54e2f1829cf41722decb0942a4d6fd3102c2c | [
"MIT"
] | 562 | 2020-12-21T14:10:20.000Z | 2022-03-31T21:23:55.000Z | compiler_gym/util/flags/episode_length.py | thecoblack/CompilerGym | ade54e2f1829cf41722decb0942a4d6fd3102c2c | [
"MIT"
] | 433 | 2020-12-22T03:40:41.000Z | 2022-03-31T18:16:17.000Z | compiler_gym/util/flags/episode_length.py | thecoblack/CompilerGym | ade54e2f1829cf41722decb0942a4d6fd3102c2c | [
"MIT"
] | 88 | 2020-12-22T08:22:00.000Z | 2022-03-20T19:00:40.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from absl import flags
flags.DEFINE_integer("episode_length", 5, "The number of steps in each episode.")
| 35.375 | 81 | 0.763251 | from absl import flags
flags.DEFINE_integer("episode_length", 5, "The number of steps in each episode.")
| true | true |
1c3f0a9ccd8484cdf510ff5f2a5708936bfbae13 | 139 | py | Python | tinychronicler/__init__.py | adzialocha/tinychronicler | 0a3fb213536dd7fc2af490c027a189fb2810903f | [
"MIT"
] | 4 | 2021-08-16T17:22:25.000Z | 2022-02-21T14:38:17.000Z | tinychronicler/__init__.py | adzialocha/tinychronicler | 0a3fb213536dd7fc2af490c027a189fb2810903f | [
"MIT"
] | null | null | null | tinychronicler/__init__.py | adzialocha/tinychronicler | 0a3fb213536dd7fc2af490c027a189fb2810903f | [
"MIT"
] | null | null | null | from .main import main
from .server import server
from .version import version as __version__
__all__ = ["__version__", "main", "server"]
| 23.166667 | 43 | 0.755396 | from .main import main
from .server import server
from .version import version as __version__
__all__ = ["__version__", "main", "server"]
| true | true |
1c3f0b2a01834fec9d729e03253215c8a0748774 | 500 | py | Python | migrations/versions/26e69577923_.py | Summerotter/furryyellowpages | 7e10786a39ddae9de5dad0236191a6258b527be8 | [
"MIT"
] | null | null | null | migrations/versions/26e69577923_.py | Summerotter/furryyellowpages | 7e10786a39ddae9de5dad0236191a6258b527be8 | [
"MIT"
] | 1 | 2021-02-02T21:46:02.000Z | 2021-02-02T21:46:02.000Z | migrations/versions/26e69577923_.py | Summerotter/furryyellowpages | 7e10786a39ddae9de5dad0236191a6258b527be8 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 26e69577923
Revises: cd1d14e435
Create Date: 2017-03-08 18:18:30.706551
"""
# revision identifiers, used by Alembic.
revision = '26e69577923'
down_revision = 'cd1d14e435'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please... | 18.518519 | 63 | 0.686 |
revision = '26e69577923'
down_revision = 'cd1d14e435'
from alembic import op
import sqlalchemy as sa
def upgrade():
pass
def downgrade():
pass
| true | true |
1c3f0b739199b034e4405680127f28833ab4e5ff | 3,077 | py | Python | flask_admin/helpers.py | pashcovich/flask-admin | f5748f25b91392012be536a81dc23fd92e5e791d | [
"BSD-3-Clause"
] | 2 | 2015-01-04T15:56:55.000Z | 2015-06-23T19:55:07.000Z | flask_admin/helpers.py | pawl/flask-admin | 700b8f4313b12d46d79d55f434db44d794fffb7d | [
"BSD-3-Clause"
] | null | null | null | flask_admin/helpers.py | pawl/flask-admin | 700b8f4313b12d46d79d55f434db44d794fffb7d | [
"BSD-3-Clause"
] | null | null | null | from re import sub
from jinja2 import contextfunction
from flask import g, request, url_for
from wtforms.validators import DataRequired, InputRequired
from flask.ext.admin._compat import urljoin, urlparse
from ._compat import string_types
def set_current_view(view):
g._admin_view = view
def get_current_view(... | 22.792593 | 95 | 0.637634 | from re import sub
from jinja2 import contextfunction
from flask import g, request, url_for
from wtforms.validators import DataRequired, InputRequired
from flask.ext.admin._compat import urljoin, urlparse
from ._compat import string_types
def set_current_view(view):
g._admin_view = view
def get_current_view(... | true | true |
1c3f0b974b912a60861d9ae2ced14645b28dda03 | 100 | py | Python | tracker/app/models/__init__.py | skielred/FairyJokeAPI | 71228e477bc6dd259e6f5f7e09b30c1e23ab96a3 | [
"MIT"
] | 3 | 2021-12-18T11:09:08.000Z | 2022-03-31T22:42:19.000Z | tracker/app/models/__init__.py | skielred/FairyJokeAPI | 71228e477bc6dd259e6f5f7e09b30c1e23ab96a3 | [
"MIT"
] | null | null | null | tracker/app/models/__init__.py | skielred/FairyJokeAPI | 71228e477bc6dd259e6f5f7e09b30c1e23ab96a3 | [
"MIT"
] | null | null | null | from .user import User
from .game import Game
from .ddr import DDRLocalChart, DDRScore, DDRScoreMod
| 25 | 53 | 0.81 | from .user import User
from .game import Game
from .ddr import DDRLocalChart, DDRScore, DDRScoreMod
| true | true |
1c3f0bfc5a08d4f9a4674c31951e141174c4e72b | 7,890 | py | Python | examples/lstm_stateful.py | asanoboy/keras | e467ee5a1a00afdfa1cb7f5508fdbfd2c5eab1e5 | [
"MIT"
] | 1 | 2017-11-01T19:10:35.000Z | 2017-11-01T19:10:35.000Z | examples/lstm_stateful.py | dmaniry/keras | 32aa192548b6b59bf407e583fbd246ba9f5f5676 | [
"MIT"
] | null | null | null | examples/lstm_stateful.py | dmaniry/keras | 32aa192548b6b59bf407e583fbd246ba9f5f5676 | [
"MIT"
] | 1 | 2019-11-19T12:13:27.000Z | 2019-11-19T12:13:27.000Z | '''Example script showing how to use a stateful LSTM model
and how its stateless counterpart performs.
More documentation about the Keras LSTM model can be found at
https://keras.io/layers/recurrent/#lstm
The models are trained on an input/output pair, where
the input is a generated uniformly distributed
random seque... | 32.603306 | 79 | 0.685805 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from keras.models import Sequential
from keras.layers import Dense, LSTM
input_len = 1000
tsteps = 2
lahead = 1
batch_size = 1
epochs = 10
print("*" * 33)
if lahead >= tsteps:
print("STATELESS LSTM WI... | true | true |
1c3f0d1dcf080b615a73e5f6e831b8581fc6ca4a | 597 | py | Python | tadataka/decorator.py | IshitaTakeshi/Tadataka | 852c7afb904503005e51884408e1492ef0be836f | [
"Apache-2.0"
] | 54 | 2019-11-15T16:30:34.000Z | 2022-01-13T15:18:54.000Z | tadataka/decorator.py | IshitaTakeshi/Tadataka | 852c7afb904503005e51884408e1492ef0be836f | [
"Apache-2.0"
] | 11 | 2019-02-28T08:28:24.000Z | 2020-04-07T04:47:12.000Z | tadataka/decorator.py | IshitaTakeshi/Tadataka | 852c7afb904503005e51884408e1492ef0be836f | [
"Apache-2.0"
] | 1 | 2020-02-26T13:59:40.000Z | 2020-02-26T13:59:40.000Z | import numpy as np
def allow_1d(which_argument):
def allow_1d_(function):
def decorated(*args, **kwargs):
args = list(args)
ndim = np.ndim(args[which_argument])
if ndim == 1:
args[which_argument] = np.atleast_2d(args[which_argument])
ret... | 27.136364 | 76 | 0.544389 | import numpy as np
def allow_1d(which_argument):
def allow_1d_(function):
def decorated(*args, **kwargs):
args = list(args)
ndim = np.ndim(args[which_argument])
if ndim == 1:
args[which_argument] = np.atleast_2d(args[which_argument])
ret... | true | true |
1c3f0d534ffb999c7a8ad354a71e615c40bb1fb1 | 6,166 | py | Python | test/countries/test_singapore.py | hugovk/python-holidays | e22c667a159c959d81b512cc354910fc5c6653a9 | [
"MIT"
] | 48 | 2016-11-22T09:18:50.000Z | 2018-01-14T14:06:49.000Z | test/countries/test_singapore.py | hugovk/python-holidays | e22c667a159c959d81b512cc354910fc5c6653a9 | [
"MIT"
] | 59 | 2016-12-03T15:52:36.000Z | 2018-01-16T09:37:15.000Z | test/countries/test_singapore.py | hugovk/python-holidays | e22c667a159c959d81b512cc354910fc5c6653a9 | [
"MIT"
] | 51 | 2016-11-25T14:53:55.000Z | 2018-01-16T09:58:56.000Z | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <maurizio.... | 45.007299 | 78 | 0.614175 |
import sys
import unittest
from datetime import date
import holidays
class TestSingapore(unittest.TestCase):
def setUp(self):
self.holidays = holidays.Singapore()
def test_Singapore(self):
self.assertIn(date(1968, 4, 13), self.holidays)
self.assertIn(date(1968, 4, 15), sel... | true | true |
1c3f0d91ed6ea18b6fa39386621d4fef7c35b322 | 10,747 | py | Python | graph_updater.py | xingdi-eric-yuan/gata | 059cd2e486adfdb5edc3e2df628d573ee9a3796b | [
"MIT"
] | 1 | 2021-04-28T03:31:07.000Z | 2021-04-28T03:31:07.000Z | graph_updater.py | xingdi-eric-yuan/gata | 059cd2e486adfdb5edc3e2df628d573ee9a3796b | [
"MIT"
] | null | null | null | graph_updater.py | xingdi-eric-yuan/gata | 059cd2e486adfdb5edc3e2df628d573ee9a3796b | [
"MIT"
] | 1 | 2021-04-28T03:32:57.000Z | 2021-04-28T03:32:57.000Z | import torch
import torch.nn as nn
from typing import Optional, Dict
from layers import GraphEncoder, TextEncoder, ReprAggregator, EncoderMixin
from utils import masked_mean
class GraphUpdater(EncoderMixin, nn.Module):
def __init__(
self,
hidden_dim: int,
word_emb_dim: int,
num_n... | 38.658273 | 87 | 0.626966 | import torch
import torch.nn as nn
from typing import Optional, Dict
from layers import GraphEncoder, TextEncoder, ReprAggregator, EncoderMixin
from utils import masked_mean
class GraphUpdater(EncoderMixin, nn.Module):
def __init__(
self,
hidden_dim: int,
word_emb_dim: int,
num_n... | true | true |
1c3f0f516f199958c86634276a1edb4466568970 | 1,189 | py | Python | test.py | nathan-gilbert/graphworks-test | 46840288bf58f726cca1f0756fa7e86457dd6768 | [
"Unlicense"
] | null | null | null | test.py | nathan-gilbert/graphworks-test | 46840288bf58f726cca1f0756fa7e86457dd6768 | [
"Unlicense"
] | null | null | null | test.py | nathan-gilbert/graphworks-test | 46840288bf58f726cca1f0756fa7e86457dd6768 | [
"Unlicense"
] | null | null | null | import json
from graphworks.algorithms.basic import find_isolated_vertices
from graphworks.algorithms.basic import generate_edges
from graphworks.export.graphviz_utils import save_to_dot
from graphworks.export.json_utils import save_to_json
from graphworks.graph import Graph
if __name__ == "__main__":
json_graph ... | 23.78 | 70 | 0.668629 | import json
from graphworks.algorithms.basic import find_isolated_vertices
from graphworks.algorithms.basic import generate_edges
from graphworks.export.graphviz_utils import save_to_dot
from graphworks.export.json_utils import save_to_json
from graphworks.graph import Graph
if __name__ == "__main__":
json_graph ... | true | true |
1c3f0f5c4ee5b5fd5a03fa9630986bf135acaa7c | 21,599 | py | Python | py/nightwatch/script.py | sbailey/nightwatch | 09c2218afd529384866e103b96aa6ed555aef85e | [
"BSD-3-Clause"
] | null | null | null | py/nightwatch/script.py | sbailey/nightwatch | 09c2218afd529384866e103b96aa6ed555aef85e | [
"BSD-3-Clause"
] | null | null | null | py/nightwatch/script.py | sbailey/nightwatch | 09c2218afd529384866e103b96aa6ed555aef85e | [
"BSD-3-Clause"
] | null | null | null | """
nightwatch command line script
"""
import os, sys, time, glob
import argparse
import traceback
import subprocess
from desimodel.io import load_tiles
import desispec.io
from . import run, plots, io
from .run import timestamp, get_ncpu
from .qa.runner import QARunner
from desiutil.log import get_logger
import temp... | 40.829868 | 240 | 0.6304 |
import os, sys, time, glob
import argparse
import traceback
import subprocess
from desimodel.io import load_tiles
import desispec.io
from . import run, plots, io
from .run import timestamp, get_ncpu
from .qa.runner import QARunner
from desiutil.log import get_logger
import tempfile
import shutil
import contextlib
i... | true | true |
1c3f0f72545da6d3e28a8e03cb7dc5cd6805e0ef | 16,612 | py | Python | monitor.py | Eternity-luo/JDC | 5356f2ea27490364342dc7a0118455bb6dfab485 | [
"MIT"
] | 8 | 2021-03-12T23:03:42.000Z | 2021-05-06T22:43:49.000Z | monitor.py | Eternity-luo/JDC | 5356f2ea27490364342dc7a0118455bb6dfab485 | [
"MIT"
] | 1 | 2021-07-03T19:07:47.000Z | 2021-07-17T05:27:33.000Z | monitor.py | Eternity-luo/JDC | 5356f2ea27490364342dc7a0118455bb6dfab485 | [
"MIT"
] | 6 | 2021-03-15T12:43:20.000Z | 2021-05-07T02:23:41.000Z | from telethon import TelegramClient, events
import time, os, sys, datetime, requests, random, string, re, json, httpx, asyncio
from jsonpath import jsonpath
import importlib
importlib.reload(sys)
requests.packages.urllib3.disable_warnings()
ckss = 'pt_key=AAJhVrPQADBghACD7FWhN04rKpDsLjchHHP8cUUCfaHBAtYDmzvaFzievcdaI3L... | 40.517073 | 492 | 0.561642 | from telethon import TelegramClient, events
import time, os, sys, datetime, requests, random, string, re, json, httpx, asyncio
from jsonpath import jsonpath
import importlib
importlib.reload(sys)
requests.packages.urllib3.disable_warnings()
ckss = 'pt_key=AAJhVrPQADBghACD7FWhN04rKpDsLjchHHP8cUUCfaHBAtYDmzvaFzievcdaI3L... | true | true |
1c3f10bc81bda7a0b5af1626ea1a5161acb6d1d9 | 537 | py | Python | adv_train/model/mnist_net.py | busycalibrating/Adversarial-Training | e1fe4061f72e1379d9920b02c1cc281e1be2606f | [
"MIT"
] | null | null | null | adv_train/model/mnist_net.py | busycalibrating/Adversarial-Training | e1fe4061f72e1379d9920b02c1cc281e1be2606f | [
"MIT"
] | null | null | null | adv_train/model/mnist_net.py | busycalibrating/Adversarial-Training | e1fe4061f72e1379d9920b02c1cc281e1be2606f | [
"MIT"
] | 1 | 2022-01-31T06:14:41.000Z | 2022-01-31T06:14:41.000Z | import torch.nn as nn
from adv_train.utils import Flatten
def build_model_mnist(device=None):
model = nn.Sequential(
nn.Conv2d(1, 32, 3, padding=1),
nn.ReLU(),
nn.Conv2d(32, 32, 3, padding=1, stride=2),
nn.ReLU(),
nn.Conv2d(32, 64, 3, padding=1),
nn.ReLU(),
... | 23.347826 | 50 | 0.532588 | import torch.nn as nn
from adv_train.utils import Flatten
def build_model_mnist(device=None):
model = nn.Sequential(
nn.Conv2d(1, 32, 3, padding=1),
nn.ReLU(),
nn.Conv2d(32, 32, 3, padding=1, stride=2),
nn.ReLU(),
nn.Conv2d(32, 64, 3, padding=1),
nn.ReLU(),
... | true | true |
1c3f112efb580d4f1117769784b589751471e3b0 | 16,989 | py | Python | mujoco/setup4/main_gailfo.py | EvieQ01/Learning-Feasibility-Different-Dynamics | 73786b11137b8ba9840d00ec4d258c1296b0a595 | [
"MIT"
] | null | null | null | mujoco/setup4/main_gailfo.py | EvieQ01/Learning-Feasibility-Different-Dynamics | 73786b11137b8ba9840d00ec4d258c1296b0a595 | [
"MIT"
] | null | null | null | mujoco/setup4/main_gailfo.py | EvieQ01/Learning-Feasibility-Different-Dynamics | 73786b11137b8ba9840d00ec4d258c1296b0a595 | [
"MIT"
] | null | null | null | import argparse
from itertools import count
import gym
import gym.spaces
import scipy.optimize
import numpy as np
import math
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from models.old_models import *
from replay_memory import Memory
from running_state import ZFilte... | 42.901515 | 206 | 0.660663 | import argparse
from itertools import count
import gym
import gym.spaces
import scipy.optimize
import numpy as np
import math
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from models.old_models import *
from replay_memory import Memory
from running_state import ZFilte... | true | true |
1c3f115aa78e8cbc7c892e6d2132d4943dd4af80 | 1,527 | py | Python | projekt/backend/biljnevrste/biljnevrsteapp/views.py | toni4848/biljnevrste_repo | 8d48a75c67a0208ddad1be78284d653fb2303c94 | [
"MIT"
] | null | null | null | projekt/backend/biljnevrste/biljnevrsteapp/views.py | toni4848/biljnevrste_repo | 8d48a75c67a0208ddad1be78284d653fb2303c94 | [
"MIT"
] | 51 | 2019-04-01T14:56:31.000Z | 2022-03-21T00:35:42.000Z | projekt/backend/biljnevrste/biljnevrsteapp/views.py | toni4848/biljnevrste_repo | 8d48a75c67a0208ddad1be78284d653fb2303c94 | [
"MIT"
] | 14 | 2019-04-02T15:22:06.000Z | 2019-06-09T13:09:40.000Z | from rest_framework import viewsets
from .serializers import *
'''
API endpoint za unos, uredjivanje uporabnih dijelova
'''
class UporabniDioViewSet(viewsets.ModelViewSet):
queryset = UporabniDio.objects.all()
serializer_class = UporabniDioSerializer
'''
API endpint za unos, uredjivanje slika
'''
class ... | 18.39759 | 52 | 0.756385 | from rest_framework import viewsets
from .serializers import *
class UporabniDioViewSet(viewsets.ModelViewSet):
queryset = UporabniDio.objects.all()
serializer_class = UporabniDioSerializer
class SlikaViewSet(viewsets.ModelViewSet):
queryset = Slika.objects.all()
serializer_class = SlikaSerializ... | true | true |
1c3f115fb666122c3ba070c75129db276760345b | 4,123 | py | Python | app/update_scheduler/views.py | AndrewLester/schedule-updates | 37ea9df14f01f7b8e7850a883760d4a692724c83 | [
"MIT"
] | 6 | 2021-02-17T03:23:18.000Z | 2021-04-09T14:35:42.000Z | app/update_scheduler/views.py | AndrewLester/schedule-updates | 37ea9df14f01f7b8e7850a883760d4a692724c83 | [
"MIT"
] | 6 | 2021-03-10T04:04:40.000Z | 2021-12-17T08:13:45.000Z | app/update_scheduler/views.py | AndrewLester/update-scheduler | 37ea9df14f01f7b8e7850a883760d4a692724c83 | [
"MIT"
] | null | null | null | from datetime import date, datetime, timedelta
from flask.globals import current_app
from flask_login.utils import login_required
from isodate.duration import Duration
import pytz
from rq.job import Job
from rq.exceptions import NoSuchJobError
from app.update_scheduler.scheduler import schedule_update
from typing impor... | 30.094891 | 92 | 0.634732 | from datetime import date, datetime, timedelta
from flask.globals import current_app
from flask_login.utils import login_required
from isodate.duration import Duration
import pytz
from rq.job import Job
from rq.exceptions import NoSuchJobError
from app.update_scheduler.scheduler import schedule_update
from typing impor... | true | true |
1c3f117b7554b5c24faba0e6bbfc5cd2f0e1466d | 720 | py | Python | mysite/polls/models.py | yangyi-d/django_base | b59543143156c1a011d31026af6de05e79aa0ce3 | [
"MIT"
] | null | null | null | mysite/polls/models.py | yangyi-d/django_base | b59543143156c1a011d31026af6de05e79aa0ce3 | [
"MIT"
] | null | null | null | mysite/polls/models.py | yangyi-d/django_base | b59543143156c1a011d31026af6de05e79aa0ce3 | [
"MIT"
] | null | null | null | from django.db import models
import datetime
# Create your models here.
from django.utils import timezone
class Question(models.Model):
"""问题模型类"""
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('datepublished')
def was_published_recently(self):
now = timez... | 23.225806 | 68 | 0.706944 | from django.db import models
import datetime
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('datepublished')
def was_published_recently(self):
now = timezone.now()
return now-datetime.time... | true | true |
1c3f11e69fe04bfb2afc4ce32bfeb9113d316cc8 | 3,109 | py | Python | classes_base/Peca.py | lffloyd/TrabalhoIA1_Domino | b78a9cbc3ff043cedda8118741bc5fbc42ee7010 | [
"MIT"
] | null | null | null | classes_base/Peca.py | lffloyd/TrabalhoIA1_Domino | b78a9cbc3ff043cedda8118741bc5fbc42ee7010 | [
"MIT"
] | null | null | null | classes_base/Peca.py | lffloyd/TrabalhoIA1_Domino | b78a9cbc3ff043cedda8118741bc5fbc42ee7010 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2018 Luiz Felipe de Melo (lffloyd), Vítor Costa (vitorhardoim), Renato Bastos (RenatoBastos33)
#
# 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 restri... | 43.788732 | 120 | 0.685751 |
class Peca():
def __init__(self, nEsq=None, nDir=None):
self.__nEsq = nEsq
self.__nDir = nDir
self.__ordem = -1
def __str__(self): return "(" + str(self.__nEsq) +"|"+ str(self.__nDir) + ")"
def __cmp__(self, other): return self.__eq__(other)
def __eq__(self, ot... | true | true |
1c3f12aef0a7e4cc86449e49fc4fb21fe710fa91 | 1,579 | py | Python | get_largest_cc.py | uniooo/graph_tools | 5cbd5f69d2a7304225b1126bbf25431cdd5bf5bf | [
"MIT"
] | null | null | null | get_largest_cc.py | uniooo/graph_tools | 5cbd5f69d2a7304225b1126bbf25431cdd5bf5bf | [
"MIT"
] | null | null | null | get_largest_cc.py | uniooo/graph_tools | 5cbd5f69d2a7304225b1126bbf25431cdd5bf5bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
'''
Author: uniooo
Date: 2021-06-01 11:28:56
LastEditors: uniooo
LastEditTime: 2021-06-03 10:15:06
FilePath: /graph_tools/get_largest_cc.py
Description:
'''
import sys
from count_ccs import get_ccs
from collections import Counter
from check_edge_consecutive import GraphChecker
d... | 31.58 | 108 | 0.632046 |
import sys
from count_ccs import get_ccs
from collections import Counter
from check_edge_consecutive import GraphChecker
def get_largest_cc(filename):
cnt, n, cc_id = get_ccs(filename)
if cnt == 1:
print("Only 1 connected components\n")
return
result = Counter(cc_id[1:])
largest_id = ... | true | true |
1c3f139daa73f91c5326ea382d5f0a2c6f80ede0 | 11,332 | py | Python | src/relstorage/adapters/mysql/locker.py | mamico/relstorage | 2df5fb721d75efad3395f34f4d6c7c34826bc56c | [
"ZPL-2.1"
] | null | null | null | src/relstorage/adapters/mysql/locker.py | mamico/relstorage | 2df5fb721d75efad3395f34f4d6c7c34826bc56c | [
"ZPL-2.1"
] | null | null | null | src/relstorage/adapters/mysql/locker.py | mamico/relstorage | 2df5fb721d75efad3395f34f4d6c7c34826bc56c | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 43.752896 | 103 | 0.677639 |
from __future__ import absolute_import
from __future__ import print_function
from contextlib import contextmanager
from zope.interface import implementer
from ..interfaces import ILocker
from ..interfaces import UnableToAcquireCommitLockError
from ..interfaces import UnableToAcquirePackUndoLockError
from ..locker i... | true | true |
1c3f150a285c70c43f3e81dc32a10b36249db1d5 | 1,442 | py | Python | ftrace/parsers/binder_transaction_buffer_release.py | bagobor/ftrace | a41bfff97447ff6503b80ffc60111cd7e53fed86 | [
"Apache-2.0"
] | 62 | 2016-05-29T15:20:15.000Z | 2022-03-11T11:40:48.000Z | ftrace/parsers/binder_transaction_buffer_release.py | bagobor/ftrace | a41bfff97447ff6503b80ffc60111cd7e53fed86 | [
"Apache-2.0"
] | 2 | 2017-12-12T09:37:40.000Z | 2018-05-09T10:29:05.000Z | ftrace/parsers/binder_transaction_buffer_release.py | bagobor/ftrace | a41bfff97447ff6503b80ffc60111cd7e53fed86 | [
"Apache-2.0"
] | 32 | 2016-08-01T08:33:22.000Z | 2021-11-03T02:18:38.000Z | import re
from ftrace.common import ParserError
from .register import register_parser
from .binder import parse_binder_cmd
from collections import namedtuple
TRACEPOINT = 'binder_transaction_buffer_release'
__all__ = [TRACEPOINT]
#binder_transaction_buffer_release: transaction=135918 data_size=28 offsets_size=0
Bin... | 28.27451 | 112 | 0.701803 | import re
from ftrace.common import ParserError
from .register import register_parser
from .binder import parse_binder_cmd
from collections import namedtuple
TRACEPOINT = 'binder_transaction_buffer_release'
__all__ = [TRACEPOINT]
BinderTransactionBufferReleaseBase = namedtuple(TRACEPOINT,
[
'transaction',
... | true | true |
1c3f1a2fe6124f3558400ab87736acd636988b9e | 7,649 | py | Python | simtools/simtel/simtel_runner_array.py | gammasim/gammasim-tools | 0b746254916f4c2e2a3fbd1854c565c3bc90d493 | [
"BSD-3-Clause"
] | 5 | 2020-06-02T09:46:38.000Z | 2022-03-26T16:42:26.000Z | simtools/simtel/simtel_runner_array.py | gammasim/gammasim-tools | 0b746254916f4c2e2a3fbd1854c565c3bc90d493 | [
"BSD-3-Clause"
] | 166 | 2020-04-24T10:22:16.000Z | 2022-03-31T12:51:02.000Z | simtools/simtel/simtel_runner_array.py | gammasim/gammasim-tools | 0b746254916f4c2e2a3fbd1854c565c3bc90d493 | [
"BSD-3-Clause"
] | null | null | null | import logging
import os
from pathlib import Path
import simtools.io_handler as io
import simtools.util.general as gen
from simtools.util import names
from simtools.simtel.simtel_runner import SimtelRunner, InvalidOutputFile
__all__ = ['SimtelRunnerArray']
class SimtelRunnerArray(SimtelRunner):
'''
SimtelRu... | 36.251185 | 97 | 0.6359 | import logging
import os
from pathlib import Path
import simtools.io_handler as io
import simtools.util.general as gen
from simtools.util import names
from simtools.simtel.simtel_runner import SimtelRunner, InvalidOutputFile
__all__ = ['SimtelRunnerArray']
class SimtelRunnerArray(SimtelRunner):
def __init__(
... | true | true |
1c3f1a31f04942811db0866efc38f49a7509460b | 13,577 | py | Python | optibot/casadi.py | AunSiro/optibot | 186c9556473071b583f1ed677e2e1a647aeb0513 | [
"MIT"
] | 1 | 2021-06-01T15:58:45.000Z | 2021-06-01T15:58:45.000Z | optibot/casadi.py | AunSiro/optibot | 186c9556473071b583f1ed677e2e1a647aeb0513 | [
"MIT"
] | null | null | null | optibot/casadi.py | AunSiro/optibot | 186c9556473071b583f1ed677e2e1a647aeb0513 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon May 31 12:52:24 2021
@author: Siro Moreno
sympy2casadi function original author: Joris Gillis
https://gist.github.com/jgillis/80bb594a6c8fcf55891d1d88b12b68b8
"""
import casadi as cas
from casadi import sin, cos
def get_str(x):
return x.__str__()
def list2casadi(va... | 31.945882 | 126 | 0.592399 |
import casadi as cas
from casadi import sin, cos
def get_str(x):
return x.__str__()
def list2casadi(vallist):
return cas.horzcat(*vallist).T
def sympy2casadi(sympy_expr, sympy_var, casadi_var):
from sympy.utilities.lambdify import lambdify
mapping = {
"ImmutableDenseMatri... | true | true |
1c3f1ac5e6b0cb7fbf8d419b4d3a085f34c38922 | 6,867 | py | Python | pokecord/dev.py | qenu/pokecord-red | 35007e83297e1bf7430aa318a7d58745e2c1943c | [
"MIT"
] | 9 | 2020-06-06T20:17:01.000Z | 2021-10-10T18:28:54.000Z | pokecord/dev.py | flaree/pokecord-red | 6810b45f3a2608c2726664b5d3d96b90c401e7b1 | [
"MIT"
] | 12 | 2020-07-09T00:32:49.000Z | 2021-11-09T20:21:02.000Z | pokecord/dev.py | qenu/pokecord-red | 35007e83297e1bf7430aa318a7d58745e2c1943c | [
"MIT"
] | 12 | 2020-07-24T15:44:15.000Z | 2022-03-14T10:14:19.000Z | import json
import pprint
from typing import Optional
import discord
import tabulate
from redbot.core import commands
from redbot.core.i18n import Translator
from redbot.core.utils.chat_formatting import *
from .abc import MixinMeta
from .pokemixin import poke
from .statements import *
_ = Translator("Pokecord", __f... | 33.661765 | 121 | 0.541139 | import json
import pprint
from typing import Optional
import discord
import tabulate
from redbot.core import commands
from redbot.core.i18n import Translator
from redbot.core.utils.chat_formatting import *
from .abc import MixinMeta
from .pokemixin import poke
from .statements import *
_ = Translator("Pokecord", __f... | true | true |
1c3f1c778320fa7c201b58bb02189d6858253a62 | 609 | py | Python | spacy_ann/types.py | StanciuMarius/spacy-ann-linker | d889a15b877c153269bc3068c8c4ed32773b182a | [
"MIT"
] | null | null | null | spacy_ann/types.py | StanciuMarius/spacy-ann-linker | d889a15b877c153269bc3068c8c4ed32773b182a | [
"MIT"
] | null | null | null | spacy_ann/types.py | StanciuMarius/spacy-ann-linker | d889a15b877c153269bc3068c8c4ed32773b182a | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from pydantic import BaseModel
class AliasCandidate(BaseModel):
"""A data class representing a candidate alias
that a NER mention may be linked to.
"""
alias: str
similarity: float
class KnowledgeBase... | 21 | 74 | 0.686371 |
from pydantic import BaseModel
class AliasCandidate(BaseModel):
alias: str
similarity: float
class KnowledgeBaseCandidate(BaseModel):
entity: str
context_similarity: float
prior_probability: float
type_label: str
index_vs_kb_type = {
0: 'UNK',
1: 'ORG',
2: 'GPE',
3: 'PERSO... | true | true |
1c3f1c80099f18839d7e33b327db7ad92b8d4137 | 3,908 | py | Python | tests/bugs/core_1512_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_1512_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_1512_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_1512
# title: Connection lost running script
# decription:
# tracker_id: CORE-1512
# min_versions: ['2.5.0']
# versions: 2.5
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
# version: 2.5
# resources: None
substitutions... | 30.771654 | 185 | 0.487462 |
import pytest
from firebird.qa import db_factory, isql_act, Action
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(page_size=4096, charset='ISO8859_1', sql_dialect=3, init=init_script_1)
test_script_1 = """
-- Confirmed crash on WI-V2.1.7.18553 for: CREATE TABLE FHO_OS(...)
CREATE DOMAIN DM... | true | true |
1c3f1fed977056deaa2fd347e047dfdb1294474b | 901 | py | Python | language/mentionmemory/utils/custom_types.py | greck2908/language | 61fa7260ac7d690d11ef72ca863e45a37c0bdc80 | [
"Apache-2.0"
] | 1,199 | 2018-10-16T01:30:18.000Z | 2022-03-31T21:05:24.000Z | language/mentionmemory/utils/custom_types.py | greck2908/language | 61fa7260ac7d690d11ef72ca863e45a37c0bdc80 | [
"Apache-2.0"
] | 116 | 2018-10-18T03:31:46.000Z | 2022-03-24T13:40:50.000Z | language/mentionmemory/utils/custom_types.py | greck2908/language | 61fa7260ac7d690d11ef72ca863e45a37c0bdc80 | [
"Apache-2.0"
] | 303 | 2018-10-22T12:35:12.000Z | 2022-03-27T17:38:17.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 34.653846 | 74 | 0.755827 | from typing import Any, Callable, Dict, Iterable
import jax.numpy as jnp
Array = jnp.ndarray
PRNGKey = jnp.ndarray
Dtype = Any
Shape = Iterable[int]
InitType = Callable[[PRNGKey, Shape, Dtype], Array]
MetricGroups = Dict[str, Dict[str, Array]]
| true | true |
1c3f2005445b5e5e44f4e6b24656f8c6abadab1b | 2,913 | py | Python | elo_system/elo_recolection_scripts/getTemporalelo.py | rafaOrtega14/tennisStats | 4f4f92532f6437a24e6c51b8aa5ac106b5d25102 | [
"MIT"
] | null | null | null | elo_system/elo_recolection_scripts/getTemporalelo.py | rafaOrtega14/tennisStats | 4f4f92532f6437a24e6c51b8aa5ac106b5d25102 | [
"MIT"
] | null | null | null | elo_system/elo_recolection_scripts/getTemporalelo.py | rafaOrtega14/tennisStats | 4f4f92532f6437a24e6c51b8aa5ac106b5d25102 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import multiprocessing
pd.options.mode.chained_assignment = None
games=pd.read_csv("TrainsetGrass.csv",low_memory=False)
players=pd.read_csv("eloCourt.csv",low_memory=False)
def find_eloplayer(ID):
hard=[]
clay=[]
grass=[]
pos=934959345
for j in range(len(pl... | 37.831169 | 136 | 0.604188 | import pandas as pd
import numpy as np
import multiprocessing
pd.options.mode.chained_assignment = None
games=pd.read_csv("TrainsetGrass.csv",low_memory=False)
players=pd.read_csv("eloCourt.csv",low_memory=False)
def find_eloplayer(ID):
hard=[]
clay=[]
grass=[]
pos=934959345
for j in range(len(pl... | true | true |
1c3f21c6980082d2b5b98180066cf9ba8b94eb50 | 156 | py | Python | utils/runtime_mode.py | omiderfanmanesh/dengue-infections-prediction | 6b4e4aa4af6f6e2cc581fd7828634bbfdc446340 | [
"Apache-2.0"
] | null | null | null | utils/runtime_mode.py | omiderfanmanesh/dengue-infections-prediction | 6b4e4aa4af6f6e2cc581fd7828634bbfdc446340 | [
"Apache-2.0"
] | null | null | null | utils/runtime_mode.py | omiderfanmanesh/dengue-infections-prediction | 6b4e4aa4af6f6e2cc581fd7828634bbfdc446340 | [
"Apache-2.0"
] | 1 | 2021-06-05T10:05:44.000Z | 2021-06-05T10:05:44.000Z | # Copyright (c) 2021, Omid Erfanmanesh, All rights reserved.
class RuntimeMode:
TRAIN = 0
TUNING = 1
CROSS_VAL = 2
FEATURE_IMPORTANCE = 3
| 19.5 | 61 | 0.666667 |
class RuntimeMode:
TRAIN = 0
TUNING = 1
CROSS_VAL = 2
FEATURE_IMPORTANCE = 3
| true | true |
1c3f21e25d49d260b961e83632b06c4e38d57eec | 42,191 | py | Python | pykotor/common/stream.py | NickHugi/PyKotor | cab1089f8a8a135861bef45340203718d39f5e1f | [
"MIT"
] | 1 | 2022-02-21T15:17:28.000Z | 2022-02-21T15:17:28.000Z | pykotor/common/stream.py | NickHugi/PyKotor | cab1089f8a8a135861bef45340203718d39f5e1f | [
"MIT"
] | 1 | 2022-03-12T16:06:23.000Z | 2022-03-12T16:06:23.000Z | pykotor/common/stream.py | NickHugi/PyKotor | cab1089f8a8a135861bef45340203718d39f5e1f | [
"MIT"
] | null | null | null | """
This module holds classes relating to read and write operations.
"""
from __future__ import annotations
import io
import struct
from abc import ABC, abstractmethod
from typing import BinaryIO, Union, TextIO, List, overload, Optional
from pykotor.common.geometry import Vector3, Vector4, Vector2
from pykotor.common.l... | 31.770331 | 120 | 0.572492 | from __future__ import annotations
import io
import struct
from abc import ABC, abstractmethod
from typing import BinaryIO, Union, TextIO, List, overload, Optional
from pykotor.common.geometry import Vector3, Vector4, Vector2
from pykotor.common.language import LocalizedString
def _endian_char(big) -> str:
return... | true | true |
1c3f2211b675a7a05e8ac50df4265131fc2f31c0 | 127 | py | Python | install.py | dmdhrumilmistry/Termux-SSH | 65ba7868a0e8961f9a262a85e79b56f8b8a65b9e | [
"MIT"
] | 5 | 2021-07-17T20:40:42.000Z | 2022-02-27T09:41:19.000Z | install.py | dmdhrumilmistry/Termux-SSH | 65ba7868a0e8961f9a262a85e79b56f8b8a65b9e | [
"MIT"
] | null | null | null | install.py | dmdhrumilmistry/Termux-SSH | 65ba7868a0e8961f9a262a85e79b56f8b8a65b9e | [
"MIT"
] | 1 | 2021-07-17T22:36:39.000Z | 2021-07-17T22:36:39.000Z | #!usr/bin/env python3
from termux import get_user, generate_passwd, install_termux_req
install_termux_req()
generate_passwd()
| 21.166667 | 64 | 0.834646 | from termux import get_user, generate_passwd, install_termux_req
install_termux_req()
generate_passwd()
| true | true |
1c3f23d96ace4872083b8af2bc17ca07cccb8d00 | 3,082 | py | Python | socialite/jython/Lib/test/test_pkg_jy.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | 49 | 2015-03-10T17:34:19.000Z | 2021-11-10T22:23:18.000Z | socialite/jython/Lib/test/test_pkg_jy.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | socialite/jython/Lib/test/test_pkg_jy.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | 32 | 2015-02-06T12:10:32.000Z | 2019-06-18T03:21:36.000Z | # Test packages (dotted-name import)
# XXX: This test is borrowed from CPython 2.7 as it tickles
# http://bugs.jython.org/issue1871 so it should be removed in Jython 2.7
import sys
import os
import tempfile
import textwrap
import unittest
from test import test_support
# Helpers to create and destroy hierarchies.
de... | 29.352381 | 72 | 0.524984 |
import sys
import os
import tempfile
import textwrap
import unittest
from test import test_support
def cleanout(root):
names = os.listdir(root)
for name in names:
fullname = os.path.join(root, name)
if os.path.isdir(fullname) and not os.path.islink(fullname):
cleanout(fullname)
... | true | true |
1c3f2546f93edc21097975e658b41e2c47bd89f7 | 4,392 | py | Python | BackpackTF/currency.py | Epicalert/BackpackTf-API | dca4b3e1e6b2ada5f7357c929bd729d673310b57 | [
"MIT"
] | null | null | null | BackpackTF/currency.py | Epicalert/BackpackTf-API | dca4b3e1e6b2ada5f7357c929bd729d673310b57 | [
"MIT"
] | null | null | null | BackpackTF/currency.py | Epicalert/BackpackTf-API | dca4b3e1e6b2ada5f7357c929bd729d673310b57 | [
"MIT"
] | 1 | 2020-03-15T21:11:33.000Z | 2020-03-15T21:11:33.000Z | class Currency:
#
# Documentation for the backpack.tf API https://backpack.tf/api/index.html#/
#
def __init__(self, apikey=""):
import requests
import json
if apikey == "":
print("Error, you need to specify an API key")
else:
self.api_key = apike... | 32.776119 | 110 | 0.574454 | class Currency:
def __init__(self, apikey=""):
import requests
import json
if apikey == "":
print("Error, you need to specify an API key")
else:
self.api_key = apikey
def getCurrencies(self):
import requests
impo... | true | true |
1c3f25eeb542dd19eee2427b9f519e968190dd43 | 1,401 | py | Python | tkinter/terminal_like.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | tkinter/terminal_like.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | tkinter/terminal_like.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | import tkinter
from tkinter import *
import subprocess
import os
from os import system as cmd
WINDOW_SIZE = "600x400"
top = tkinter.Tk()
top.geometry(WINDOW_SIZE)
def helloCallBack():
print ("Below is the output from the shell script in terminal")
subprocess.call('perl /projects/tfs/users/$USER/scripts_coverage... | 31.840909 | 98 | 0.745896 | import tkinter
from tkinter import *
import subprocess
import os
from os import system as cmd
WINDOW_SIZE = "600x400"
top = tkinter.Tk()
top.geometry(WINDOW_SIZE)
def helloCallBack():
print ("Below is the output from the shell script in terminal")
subprocess.call('perl /projects/tfs/users/$USER/scripts_coverage... | true | true |
1c3f28246dcadec804bcbfc32bf5b0c6e925821b | 1,238 | py | Python | Python/standardDeviation.py | giandrea77/RExercises | d435e303775b154d4cbbc25f990eb4b23272039d | [
"MIT"
] | null | null | null | Python/standardDeviation.py | giandrea77/RExercises | d435e303775b154d4cbbc25f990eb4b23272039d | [
"MIT"
] | null | null | null | Python/standardDeviation.py | giandrea77/RExercises | d435e303775b154d4cbbc25f990eb4b23272039d | [
"MIT"
] | null | null | null | #
# Exerciese from book Data Science - Sinan Ozdemir
#
# @since : Fri Apr 9 14:41:38 CEST 2021
#
### Calculate standard deviance
#
# Distanza di un punto dei dati rispetto alla media
#
import numpy
temps = [32, 32, 31, 28, 29, 31, 39, 32, 32, 35, 26, 29]
# Calculate mean of values
mean = numpy.mean(temps)
square... | 24.76 | 60 | 0.703554 |
import numpy
temps = [32, 32, 31, 28, 29, 31, 39, 32, 32, 35, 26, 29]
mean = numpy.mean(temps)
squared_differences = []
num_items = len(temps)
products = 1
for temperature in temps:
products *= temperature
geometric_mean = products ** (1./num_items)
difference = temperature - mean
s... | true | true |
1c3f283673b6f1a01e98e29d842f6d08e7c0768c | 880 | py | Python | common/ciphers/block/counter.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | 2 | 2015-04-04T01:44:11.000Z | 2017-11-04T11:59:27.000Z | common/ciphers/block/counter.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | common/ciphers/block/counter.py | lukius/mts | 96d3d8b28742a474aca67bfcb079577c878bbb4c | [
"MIT"
] | null | null | null | from modes import CTR
from common.tools.endianness import LittleEndian
class CTRModeCounter(object):
def __init__(self, block_size):
self.block_size = block_size if block_size is not None\
else CTR.DEFAULT_BLOCK_SIZE
def count(self, index):
raise NotImpleme... | 27.5 | 73 | 0.663636 | from modes import CTR
from common.tools.endianness import LittleEndian
class CTRModeCounter(object):
def __init__(self, block_size):
self.block_size = block_size if block_size is not None\
else CTR.DEFAULT_BLOCK_SIZE
def count(self, index):
raise NotImpleme... | true | true |
1c3f2a0faae6c5df9633a8467f5fe3dafec0dc15 | 1,911 | py | Python | murano/cmd/engine.py | ISCAS-VDI/murano-base | 34287bd9109b32a2bb0960c0428fe402dee6d9b2 | [
"Apache-2.0"
] | 1 | 2021-07-28T23:19:49.000Z | 2021-07-28T23:19:49.000Z | murano/cmd/engine.py | ISCAS-VDI/murano-base | 34287bd9109b32a2bb0960c0428fe402dee6d9b2 | [
"Apache-2.0"
] | null | null | null | murano/cmd/engine.py | ISCAS-VDI/murano-base | 34287bd9109b32a2bb0960c0428fe402dee6d9b2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2013 Mirantis, 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 re... | 28.954545 | 79 | 0.685505 |
import os
import eventlet
if os.name == 'nt':
eventlet.monkey_patch(os=False)
else:
eventlet.monkey_patch()
import sys
from oslo_concurrency import processutils
from oslo_log import log as logging
from oslo_service import service
from murano.common import config
from murano.common import engine
... | true | true |
1c3f2a49078e66fc5cfdd4857b54f8ca97fad00f | 1,788 | py | Python | jdcloud_sdk/services/instancevoucher/apis/ModifyInstanceVoucherAttributeRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/instancevoucher/apis/ModifyInstanceVoucherAttributeRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/instancevoucher/apis/ModifyInstanceVoucherAttributeRequest.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 29.8 | 128 | 0.69519 |
from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest
class ModifyInstanceVoucherAttributeRequest(JDCloudRequest):
def __init__(self, parameters, header=None, version="v1"):
super(ModifyInstanceVoucherAttributeRequest, self).__init__(
'/regions/{regionId}/instanceVouchers/{instanceVouc... | true | true |
1c3f2d7330211692e7ce6d41afd076ec8b682f77 | 16,747 | py | Python | GUI/PyQt/utils/CNN_main.py | thomaskuestner/CNNArt | c2fc639dd2ce035f6ca90113290682a0ccd26fb8 | [
"Apache-2.0"
] | 22 | 2018-04-27T21:28:46.000Z | 2021-12-24T06:44:55.000Z | GUI/PyQt/utils/CNN_main.py | thomaskuestner/CNNArt | c2fc639dd2ce035f6ca90113290682a0ccd26fb8 | [
"Apache-2.0"
] | 81 | 2017-11-09T17:23:15.000Z | 2020-01-28T22:54:13.000Z | GUI/PyQt/utils/CNN_main.py | thomaskuestner/CNNArt | c2fc639dd2ce035f6ca90113290682a0ccd26fb8 | [
"Apache-2.0"
] | 18 | 2017-11-13T16:12:17.000Z | 2020-08-27T10:17:34.000Z | # -*- coding: utf-8 -*-
"""
----------------------------------
Main function for calling the CNNs
----------------------------------
Created on Wed Jan 27 16:57:10 2016
Copyright: 2016, 2017 Thomas Kuestner (thomas.kuestner@med.uni-tuebingen.de) under Apache2 license
@author: Thomas Kuestner
"""
from tensorflow.python.... | 46.519444 | 153 | 0.526482 | from tensorflow.python.keras.models import load_model
from config.PATH import CNN_PATH
import sys
import numpy as np import h5py
import scipy.io as sio import os.path import argparse
import keras.backend as K
from networks.motion.CNN2D import *
from networks.motion.CNN3D import *
from networks.motion.MNetArt imp... | true | true |
1c3f2f8cea0a7ff37db06a263707542c416d7769 | 1,614 | py | Python | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/15_features/numtrees_30/rule_22.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/15_features/numtrees_30/rule_22.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/15_features/numtrees_30/rule_22.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Coupon_validity, obj[4]: Gender, obj[5]: Age, obj[6]: Children, obj[7]: Education, obj[8]: Occupation, obj[9]: Income, obj[10]: Bar, obj[11]: Coffeehouse, obj[12]: Restaurant20to50, obj[13]: Direction_same, obj[14]: Distance
# {"feature":... | 37.534884 | 305 | 0.581784 | def findDecision(obj): if obj[9]<=6:
if obj[0]>1:
if obj[4]>0:
return 'True'
elif obj[4]<=0:
if obj[7]>0:
if obj[5]<=3:
return 'False'
elif obj[5]>3:
return 'True'
else: return 'True'
elif obj[7]<=0:
return 'True'
else: return 'True'
else: retur... | true | true |
1c3f3071b3c658bb957cf41a58de0fac4bd47b97 | 2,081 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/functional/ftu/test_ftu_with_tour.py | woslinux/gaia | eb6766d52c64a906101e548550cf09c23dad15e8 | [
"Apache-2.0"
] | 1 | 2019-04-26T21:30:24.000Z | 2019-04-26T21:30:24.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/ftu/test_ftu_with_tour.py | woslinux/gaia | eb6766d52c64a906101e548550cf09c23dad15e8 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/functional/ftu/test_ftu_with_tour.py | woslinux/gaia | eb6766d52c64a906101e548550cf09c23dad15e8 | [
"Apache-2.0"
] | 1 | 2021-09-03T10:18:22.000Z | 2021-09-03T10:18:22.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.apps.ftu.app import Ftu
from gaiatest.apps.homescreen.app import Homescr... | 43.354167 | 158 | 0.697261 |
from gaiatest import GaiaTestCase
from gaiatest.apps.ftu.app import Ftu
from gaiatest.apps.homescreen.app import Homescreen
class TestFtu(GaiaTestCase):
def setUp(self):
GaiaTestCase.setUp(self)
self.ftu = Ftu(self.marionette)
self.ftu.launch()
def test_ftu_with_tour(self):
... | true | true |
1c3f30fcc910ed268fb074d46de85f5729d9d8ae | 859 | py | Python | utils/vocab_utils.py | sciforce/phones-las | f95523fbbdf1dd7f1acce5b25c37b620f3eb8e9b | [
"Apache-2.0"
] | 35 | 2019-07-04T10:13:29.000Z | 2022-02-22T03:41:39.000Z | utils/vocab_utils.py | sciforce/phones-las | f95523fbbdf1dd7f1acce5b25c37b620f3eb8e9b | [
"Apache-2.0"
] | 7 | 2019-11-04T15:34:03.000Z | 2020-06-21T04:30:22.000Z | utils/vocab_utils.py | sciforce/phones-las | f95523fbbdf1dd7f1acce5b25c37b620f3eb8e9b | [
"Apache-2.0"
] | 5 | 2019-07-15T20:09:46.000Z | 2021-08-05T09:55:29.000Z | import tensorflow as tf
import pickle
__all__ = [
'create_vocab_table',
'load_vocab',
'UNK',
'SOS',
'EOS',
'UNK_ID',
'SOS_ID',
'EOS_ID',
]
UNK = '<unk>'
SOS = '<s>'
EOS = '</s>'
UNK_ID = 0
SOS_ID = 1
EOS_ID = 2
def load_vocab(filename):
if not '.pickle' in filename:
with... | 20.452381 | 73 | 0.605355 | import tensorflow as tf
import pickle
__all__ = [
'create_vocab_table',
'load_vocab',
'UNK',
'SOS',
'EOS',
'UNK_ID',
'SOS_ID',
'EOS_ID',
]
UNK = '<unk>'
SOS = '<s>'
EOS = '</s>'
UNK_ID = 0
SOS_ID = 1
EOS_ID = 2
def load_vocab(filename):
if not '.pickle' in filename:
with... | true | true |
1c3f334e33497dd3183a46e03be879ae0cc7ebf6 | 5,664 | py | Python | tf_slim/nets/overfeat.py | adrianc-a/tf-slim | 4d4496e5ad26747f0d9f7b8af754ed73d56cede5 | [
"Apache-2.0"
] | 4 | 2019-11-07T09:20:52.000Z | 2022-01-04T22:38:22.000Z | tf_slim/nets/overfeat.py | adrianc-a/tf-slim | 4d4496e5ad26747f0d9f7b8af754ed73d56cede5 | [
"Apache-2.0"
] | 1 | 2019-12-02T10:10:58.000Z | 2019-12-02T10:10:58.000Z | tf_slim/nets/overfeat.py | adrianc-a/tf-slim | 4d4496e5ad26747f0d9f7b8af754ed73d56cede5 | [
"Apache-2.0"
] | 6 | 2019-11-27T19:25:58.000Z | 2022-01-26T07:54:22.000Z | # coding=utf-8
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 42.268657 | 80 | 0.707627 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib import layers
from tensorflow.contrib.framework.python.ops import arg_scope
from tensorflow.contrib.layers.python.layers import layers as layers_lib
from tensorflow.contrib.layers.pytho... | true | true |
1c3f3429032667dca3939a237e76121898898372 | 13,890 | py | Python | David and Pooja/++Validating Linked Mods/Python-3.0/Lib/binhex.py | LinkedModernismProject/web_code | 4cf6bf53d5c3249e52a75f0a3f57d106e31daf9e | [
"Apache-2.0"
] | 1 | 2015-05-21T23:47:54.000Z | 2015-05-21T23:47:54.000Z | front-end/testsuite-python-lib/Python-3.1/Lib/binhex.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2015-10-29T20:51:31.000Z | 2015-10-29T20:51:31.000Z | front-end/testsuite-python-lib/Python-3.1/Lib/binhex.py | MalloyPower/parsing-python | b2bca5eed07ea2af7a2001cd4f63becdfb0570be | [
"MIT"
] | 1 | 2019-04-11T11:27:01.000Z | 2019-04-11T11:27:01.000Z | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXX... | 28.9375 | 79 | 0.54838 |
# input. The resulting code (xx 90 90) would appear to be interpreted as an
# escaped *value* of 0x90. All coders I've seen appear to ignore this nicety...
import io
import os
import sys
import struct
import binascii
__all__ = ["binhex","hexbin","Error"]
class Error(Exception):
pass
[_DID_HEADER, _DID_DATA, _DI... | true | true |
1c3f34b102d2f0b88d8546b3a531125fc9dd1649 | 485 | py | Python | src/schemas/service_schema.py | Nardri/rbac-service | c5cf6baf60e95a7790156c85e37c76c697efd585 | [
"MIT"
] | null | null | null | src/schemas/service_schema.py | Nardri/rbac-service | c5cf6baf60e95a7790156c85e37c76c697efd585 | [
"MIT"
] | null | null | null | src/schemas/service_schema.py | Nardri/rbac-service | c5cf6baf60e95a7790156c85e37c76c697efd585 | [
"MIT"
] | null | null | null | """Service schema module"""
from marshmallow import fields, validate, post_load
from src.schemas import BaseSchema
class ServiceSchema(BaseSchema):
"""Schema class"""
name = fields.String(required=True,
validate=[validate.Length(min=3, max=100)])
@post_load
def append_servi... | 25.526316 | 68 | 0.643299 |
from marshmallow import fields, validate, post_load
from src.schemas import BaseSchema
class ServiceSchema(BaseSchema):
name = fields.String(required=True,
validate=[validate.Length(min=3, max=100)])
@post_load
def append_service_to_name(self, data, **kwargs):
data['na... | true | true |
1c3f34f9e49804db348754d24fea1e5a877cf275 | 315 | py | Python | venafi_vcert_gitlab_integration/version_command.py | fullstaq-labs/venafi-vcert-gitlab-integration | bb4549e1d83a4afe177665f04ca778e7c4f59d75 | [
"Apache-2.0"
] | null | null | null | venafi_vcert_gitlab_integration/version_command.py | fullstaq-labs/venafi-vcert-gitlab-integration | bb4549e1d83a4afe177665f04ca778e7c4f59d75 | [
"Apache-2.0"
] | 3 | 2021-06-07T08:08:07.000Z | 2021-08-02T09:25:56.000Z | venafi_vcert_gitlab_integration/version_command.py | fullstaq-labs/venafi-vcert-gitlab-integration | bb4549e1d83a4afe177665f04ca778e7c4f59d75 | [
"Apache-2.0"
] | null | null | null | import os
module_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
def read_product_version():
with open(os.path.join(module_dir, 'version.txt'), 'r', encoding='UTF-8') as f:
return f.read().strip()
def main():
print(read_product_version())
if __name__ == '__main__':
main()
| 18.529412 | 83 | 0.663492 | import os
module_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
def read_product_version():
with open(os.path.join(module_dir, 'version.txt'), 'r', encoding='UTF-8') as f:
return f.read().strip()
def main():
print(read_product_version())
if __name__ == '__main__':
main()
| true | true |
1c3f35e8ed1199cf7a5df4b9f29f45e0ee1e147e | 852 | py | Python | CoinCounter.py | KRHS-GameProgramming-2018/The-Adventures-of-Spaceman | 030ce5006344ffab595309949ad5eef42d6f4aa9 | [
"BSD-2-Clause"
] | null | null | null | CoinCounter.py | KRHS-GameProgramming-2018/The-Adventures-of-Spaceman | 030ce5006344ffab595309949ad5eef42d6f4aa9 | [
"BSD-2-Clause"
] | 11 | 2019-01-28T13:09:29.000Z | 2019-03-12T12:19:38.000Z | CoinCounter.py | KRHS-GameProgramming-2018/The-Adventures-of-Spaceman | 030ce5006344ffab595309949ad5eef42d6f4aa9 | [
"BSD-2-Clause"
] | null | null | null | import pygame, sys, math
#HealthBar and Power Ups
class CoinCounter(pygame.sprite.Sprite):
def __init__(self, coins=0, pos = [0,0]):
pygame.sprite.Sprite.__init__(self, self.containers)
self.coin = coins
self.font = pygame.font.Font("8-Bit Madness.ttf", 48)
# ~ self... | 31.555556 | 74 | 0.585681 | import pygame, sys, math
class CoinCounter(pygame.sprite.Sprite):
def __init__(self, coins=0, pos = [0,0]):
pygame.sprite.Sprite.__init__(self, self.containers)
self.coin = coins
self.font = pygame.font.Font("8-Bit Madness.ttf", 48)
self.image = self.... | true | true |
1c3f37b0d6abe80e9abf5047bd200068d3915b3b | 280 | py | Python | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | from django import template
from camper.pages.models import Chunk
register = template.Library()
@register.simple_tag(name='chunk')
def do_chunk(slug):
try:
c = Chunk.objects.get(slug=slug)
return c.content
except Chunk.DoesNotExist:
return ''
| 17.5 | 40 | 0.682143 | from django import template
from camper.pages.models import Chunk
register = template.Library()
@register.simple_tag(name='chunk')
def do_chunk(slug):
try:
c = Chunk.objects.get(slug=slug)
return c.content
except Chunk.DoesNotExist:
return ''
| true | true |
1c3f38cdc80a2becaf809b2b5084b77fa89579c6 | 682 | py | Python | web/api/app.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 13 | 2018-12-17T23:30:54.000Z | 2021-12-29T14:31:43.000Z | web/api/app.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 36 | 2018-06-07T21:34:13.000Z | 2022-03-13T21:01:43.000Z | web/api/app.py | kosyachniy/dev | 39bb5c5ee10780bfcd8a59cf59cfb1a348ac52a4 | [
"Apache-2.0"
] | 2 | 2021-01-03T11:47:20.000Z | 2021-12-29T14:31:49.000Z | from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
class Input(BaseModel):
method: str
params: dict = {}
locale: str = 'en'
token: str = None
app = FastAPI(title='Web app API')
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
... | 21.3125 | 66 | 0.680352 | from fastapi import FastAPI, Request
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
class Input(BaseModel):
method: str
params: dict = {}
locale: str = 'en'
token: str = None
app = FastAPI(title='Web app API')
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
... | true | true |
1c3f39799557f9a44493355c1da9e2d7a9f96e9d | 50,056 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | null | null | null | pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | null | null | null | """Common configure functions for interface"""
# Python
import logging
# Unicon
from unicon.core.errors import SubCommandFailure
# Steps
from pyats.aetest.steps import Steps
# Genie
from genie.conf.base import Interface
from genie.libs.conf.base import IPv4Address, IPv6Address
from genie.libs.conf.interface import ... | 29.306792 | 114 | 0.567484 |
import logging
from unicon.core.errors import SubCommandFailure
from pyats.aetest.steps import Steps
from genie.conf.base import Interface
from genie.libs.conf.base import IPv4Address, IPv6Address
from genie.libs.conf.interface import IPv4Addr, IPv6Addr
from genie.harness.utils import connect_device
from genie.lib... | true | true |
1c3f39a368018d62b2c631d5a8d2532741dedc90 | 6,827 | py | Python | checkTasks.py | Paola351/recurring-tasks | d05abc8d4029eee3638c18a468b607f9c548c6f6 | [
"MIT"
] | null | null | null | checkTasks.py | Paola351/recurring-tasks | d05abc8d4029eee3638c18a468b607f9c548c6f6 | [
"MIT"
] | null | null | null | checkTasks.py | Paola351/recurring-tasks | d05abc8d4029eee3638c18a468b607f9c548c6f6 | [
"MIT"
] | null | null | null | import configparser, sendMail
from datetime import datetime
import logging
logging.basicConfig(level='DEBUG', filename='logs/app.log', filemode='a', format='%(name)s - %(levelname)s - %(asctime)s - %(message)s')
taskTypeList = ["daily", "weekly", "monthly", "weekdayofmonth", "yearly", "free"]
daysOfTheWeek = ["Monday... | 44.045161 | 136 | 0.56174 | import configparser, sendMail
from datetime import datetime
import logging
logging.basicConfig(level='DEBUG', filename='logs/app.log', filemode='a', format='%(name)s - %(levelname)s - %(asctime)s - %(message)s')
taskTypeList = ["daily", "weekly", "monthly", "weekdayofmonth", "yearly", "free"]
daysOfTheWeek = ["Monday... | true | true |
1c3f39cffcbd5fc2bd8e3c59a4f930fe745144cc | 2,179 | py | Python | Bot/sending_emails.py | DogsonPl/bot_for_messenger | 2d6664b52b59696dc82efb3d361b7700ebb3960b | [
"MIT"
] | 19 | 2021-03-11T12:59:00.000Z | 2022-02-12T18:50:58.000Z | Bot/sending_emails.py | DogsonPl/bot_for_messenger | 2d6664b52b59696dc82efb3d361b7700ebb3960b | [
"MIT"
] | null | null | null | Bot/sending_emails.py | DogsonPl/bot_for_messenger | 2d6664b52b59696dc82efb3d361b7700ebb3960b | [
"MIT"
] | 4 | 2021-03-10T23:07:13.000Z | 2021-09-28T18:55:30.000Z | import random as rd
import asyncio
import aiosmtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from . import parse_config
async def get_confirmation_code():
confirmation_code = rd.randint(10000, 99999)
return confirmation_code
class SmptConnection:
def __init_... | 35.721311 | 120 | 0.662689 | import random as rd
import asyncio
import aiosmtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from . import parse_config
async def get_confirmation_code():
confirmation_code = rd.randint(10000, 99999)
return confirmation_code
class SmptConnection:
def __init_... | true | true |
1c3f39e71209012af52fd19efc149b2e9bb09f5e | 8,485 | py | Python | docs/conf.py | lalmeras/clickable | 6182f8a106c202a9bb1e6d7142e2b5b4734c13f3 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | lalmeras/clickable | 6182f8a106c202a9bb1e6d7142e2b5b4734c13f3 | [
"BSD-3-Clause"
] | 297 | 2017-09-29T23:51:42.000Z | 2021-08-31T09:27:17.000Z | docs/conf.py | lalmeras/clickable | 6182f8a106c202a9bb1e6d7142e2b5b4734c13f3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# clickable documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... | 30.742754 | 76 | 0.717384 |
import sys
import os
cwd = os.getcwd()
project_root = os.path.dirname(cwd)
sys.path.insert(0, project_root)
import clickable
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'clickable helper scripts'
copyright... | true | true |
1c3f3a76aba94a9ad074c4c60884e68d0eb42c07 | 1,148 | py | Python | setup.py | kttian/ifcc | 017827fb175713802d3128de4841cc4d54cc7598 | [
"Apache-2.0"
] | 43 | 2020-10-21T03:25:21.000Z | 2022-03-26T08:13:06.000Z | setup.py | kttian/ifcc | 017827fb175713802d3128de4841cc4d54cc7598 | [
"Apache-2.0"
] | 8 | 2020-12-04T15:06:45.000Z | 2022-03-28T12:18:14.000Z | setup.py | kttian/ifcc | 017827fb175713802d3128de4841cc4d54cc7598 | [
"Apache-2.0"
] | 10 | 2020-11-13T03:46:09.000Z | 2022-02-05T21:39:52.000Z | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ifcc',
version='0.2.0',
author='Yasuhide Miura',
author_email='ysmiura@stanford.edu',
description='The code of: Improving Factual Completeness and Consistency of Image-to-text Radiology R... | 26.697674 | 123 | 0.550523 | import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='ifcc',
version='0.2.0',
author='Yasuhide Miura',
author_email='ysmiura@stanford.edu',
description='The code of: Improving Factual Completeness and Consistency of Image-to-text Radiology R... | true | true |
1c3f3acd79d785a1aab6f01a36bd71f0c6d3cbac | 39 | py | Python | protocols/protocol_7_0/coverage.py | Lucioric2000/GelReportModels | 1704cdea3242d5b46c8b81ef46553ccae2799435 | [
"Apache-2.0"
] | null | null | null | protocols/protocol_7_0/coverage.py | Lucioric2000/GelReportModels | 1704cdea3242d5b46c8b81ef46553ccae2799435 | [
"Apache-2.0"
] | null | null | null | protocols/protocol_7_0/coverage.py | Lucioric2000/GelReportModels | 1704cdea3242d5b46c8b81ef46553ccae2799435 | [
"Apache-2.0"
] | null | null | null | from protocols.coverage_0_1_0 import *
| 19.5 | 38 | 0.846154 | from protocols.coverage_0_1_0 import *
| true | true |
1c3f3b07e8b2c3bb8e69f784a981b7d41aebc9f9 | 212 | py | Python | Symbol Patterns/symbolicpattern38.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 8 | 2021-03-20T11:26:35.000Z | 2022-01-05T02:39:15.000Z | Symbol Patterns/symbolicpattern38.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 851 | 2021-04-02T09:08:15.000Z | 2022-01-12T11:26:57.000Z | Symbol Patterns/symbolicpattern38.py | Daksh777/Python-PatternHouse | ab801631c2e1f5ed3cc12a26c959d41a5e51273d | [
"MIT"
] | 15 | 2021-04-13T06:10:17.000Z | 2022-01-08T05:07:21.000Z | print("Enter the no of rows: ")
n = int(input())
for i in range(0, n):
for j in range(0, i+1):
if j % 2 == 0:
print("#", end=" ")
else:
print("*", end=" ")
print()
| 21.2 | 31 | 0.410377 | print("Enter the no of rows: ")
n = int(input())
for i in range(0, n):
for j in range(0, i+1):
if j % 2 == 0:
print("#", end=" ")
else:
print("*", end=" ")
print()
| true | true |
1c3f3b3bcfad31e4d9aa1a8ba8c130cb3fca91f0 | 925 | py | Python | mainland/_main.py | moshez/mainland | 4aadf63d6e971518940828b1cc0b648ff5629bdd | [
"MIT"
] | null | null | null | mainland/_main.py | moshez/mainland | 4aadf63d6e971518940828b1cc0b648ff5629bdd | [
"MIT"
] | 1 | 2015-06-28T04:29:16.000Z | 2015-06-28T04:29:16.000Z | mainland/_main.py | moshez/mainland | 4aadf63d6e971518940828b1cc0b648ff5629bdd | [
"MIT"
] | null | null | null | # Copyright (c) Moshe Zadka
# See LICENSE for details.
import importlib
def main(argv, root, suffix=None, marker=None):
argv = list(argv)
argv.pop(0)
if not argv:
raise SystemExit('Need subcommand name')
moduleName = argv[0]
if not root.endswith('.'):
root += '.'
moduleName = ... | 25.694444 | 64 | 0.616216 |
import importlib
def main(argv, root, suffix=None, marker=None):
argv = list(argv)
argv.pop(0)
if not argv:
raise SystemExit('Need subcommand name')
moduleName = argv[0]
if not root.endswith('.'):
root += '.'
moduleName = root + moduleName
if marker is None:
marker... | true | true |
1c3f3cab650e18c49a607e9a58896887699da0e5 | 6,288 | py | Python | train.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | 2 | 2019-07-30T06:50:21.000Z | 2020-02-05T17:42:06.000Z | train.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | 1 | 2019-08-20T08:57:21.000Z | 2019-08-21T08:49:48.000Z | train.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import configargparse
import onmt.opts as opts
import os
import random
from itertools import chain
import torch
import torchtext
# from torchtext.data.iterator import Iterator
from onmt.model_builder import build_model
from onmt.trainer import build_trainer
from onmt.utils.logging import init... | 33.625668 | 78 | 0.655057 |
import configargparse
import onmt.opts as opts
import os
import random
from itertools import chain
import torch
import torchtext
from onmt.model_builder import build_model
from onmt.trainer import build_trainer
from onmt.utils.logging import init_logger, logger
from onmt.utils.misc import use_gpu
class OrderedIt... | true | true |
1c3f3d09d01c34a2e0a05784c79668ab8345ab5d | 16,772 | py | Python | datacube/_version.py | Zac-HD/datacube-core | ebc2025b6fb9d22fb406cdf5f79eba6d144c57e3 | [
"Apache-2.0"
] | 27 | 2016-08-16T18:22:47.000Z | 2018-08-25T17:18:15.000Z | datacube/_version.py | cronosnull/agdc-v2 | 596923779d3650c47a6b43276b3369a5ec619158 | [
"Apache-2.0"
] | 103 | 2018-03-21T15:00:05.000Z | 2020-06-04T05:40:25.000Z | datacube/_version.py | cronosnull/agdc-v2 | 596923779d3650c47a6b43276b3369a5ec619158 | [
"Apache-2.0"
] | 27 | 2016-08-26T18:14:40.000Z | 2021-12-24T08:41:29.000Z |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 34.439425 | 79 | 0.590866 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
keywords = {"refnames": git_refnames, "full": git_full}
return keywords
class VersioneerConfig:
def get_config():
cfg = Versionee... | true | true |
1c3f3d27fb37722a95dadc0a104c89f03af4fc1c | 1,652 | py | Python | app/distribution/forms/settings.py | RinKiruko/MatHelp | 5178f83fdf46c92be1014e18e63d64f36e80082e | [
"MIT"
] | null | null | null | app/distribution/forms/settings.py | RinKiruko/MatHelp | 5178f83fdf46c92be1014e18e63d64f36e80082e | [
"MIT"
] | null | null | null | app/distribution/forms/settings.py | RinKiruko/MatHelp | 5178f83fdf46c92be1014e18e63d64f36e80082e | [
"MIT"
] | null | null | null | from django import forms
from django.db.models import QuerySet
from django.utils import timezone
from crud.models import StatementCategory, Statement
from general.forms import *
MONTH_CHOICES = (
(1, 'Январь'),
(2, 'Февраль'),
(3, 'Март'),
(4, 'Апрель'),
(5, 'Май'),
(6, 'Июнь'),
(7, 'Июль'... | 24.656716 | 91 | 0.591404 | from django import forms
from django.db.models import QuerySet
from django.utils import timezone
from crud.models import StatementCategory, Statement
from general.forms import *
MONTH_CHOICES = (
(1, 'Январь'),
(2, 'Февраль'),
(3, 'Март'),
(4, 'Апрель'),
(5, 'Май'),
(6, 'Июнь'),
(7, 'Июль'... | true | true |
1c3f3daf361120283f4d06efaa952302acb7fa00 | 16,093 | py | Python | tests/test_adt.py | deztructor/pycor | f77e3f197ddda276932af9d3a19e89a590971d3d | [
"MIT"
] | null | null | null | tests/test_adt.py | deztructor/pycor | f77e3f197ddda276932af9d3a19e89a590971d3d | [
"MIT"
] | null | null | null | tests/test_adt.py | deztructor/pycor | f77e3f197ddda276932af9d3a19e89a590971d3d | [
"MIT"
] | null | null | null | from collections import namedtuple
from enum import Enum
from functools import partial
import types
import pytest
from cor.adt.error import (
AccessError,
InvalidFieldError,
MissingFieldError,
RecordError,
)
from cor.adt.hook import (
HooksFactory,
field_invariant,
Target,
)
from cor.adt.r... | 26.956449 | 108 | 0.600199 | from collections import namedtuple
from enum import Enum
from functools import partial
import types
import pytest
from cor.adt.error import (
AccessError,
InvalidFieldError,
MissingFieldError,
RecordError,
)
from cor.adt.hook import (
HooksFactory,
field_invariant,
Target,
)
from cor.adt.r... | true | true |
1c3f3dba7e5615f38b36309c6c6af4695a82f1c3 | 222 | py | Python | python_class/mylist.py | wasit7/cs402 | 5a0f945eb7c9944edc0a423d5c37bc4ef867b950 | [
"MIT"
] | null | null | null | python_class/mylist.py | wasit7/cs402 | 5a0f945eb7c9944edc0a423d5c37bc4ef867b950 | [
"MIT"
] | null | null | null | python_class/mylist.py | wasit7/cs402 | 5a0f945eb7c9944edc0a423d5c37bc4ef867b950 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 19 11:03:23 2015
@author: Wasit
"""
mylist=[]
mylist.append(7)
mylist.append("my string")
mylist.append('my string again')
another_list=[1,2,3]
mylist.append(another_list) | 14.8 | 35 | 0.68018 |
mylist=[]
mylist.append(7)
mylist.append("my string")
mylist.append('my string again')
another_list=[1,2,3]
mylist.append(another_list) | true | true |
1c3f3eaad60aae87f0b648d03b91a17e4f0ba778 | 82,340 | py | Python | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2019-08-23T21:14:00.000Z | 2021-09-07T18:32:34.000Z | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | null | null | null | sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/operations/_volumes_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.591479 | 269 | 0.649964 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
1c3f406dfd935bf28aae35459dc00f6c4f609492 | 16,352 | bzl | Python | scala/scala_maven_import_external.bzl | SeaJaredCode/rules_scala | c291447cabd35fd051989cad000b6ec6490285fd | [
"Apache-2.0"
] | null | null | null | scala/scala_maven_import_external.bzl | SeaJaredCode/rules_scala | c291447cabd35fd051989cad000b6ec6490285fd | [
"Apache-2.0"
] | null | null | null | scala/scala_maven_import_external.bzl | SeaJaredCode/rules_scala | c291447cabd35fd051989cad000b6ec6490285fd | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 37.248292 | 164 | 0.694777 |
_HEADER = "# DO NOT EDIT: generated by jvm_import_external()"
_PASS_PROPS = (
"neverlink",
"testonly_",
"visibility",
"exports",
"runtime_deps",
"deps",
"tags",
)
def _jvm_import_external(repository_ctx):
if (repository_ctx.attr.generated_linkable_rule_name and
not repository_c... | true | true |
1c3f40ba3671355bb84bec525b3ec2763f6c7c75 | 3,097 | py | Python | backend/backend/settings.py | RebornBeat/CodeEmerge | 81066b1be8690c4600e3c656d7da45f035ab2ad7 | [
"MIT"
] | null | null | null | backend/backend/settings.py | RebornBeat/CodeEmerge | 81066b1be8690c4600e3c656d7da45f035ab2ad7 | [
"MIT"
] | null | null | null | backend/backend/settings.py | RebornBeat/CodeEmerge | 81066b1be8690c4600e3c656d7da45f035ab2ad7 | [
"MIT"
] | null | null | null | """
Django settings for backend project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib... | 25.385246 | 91 | 0.693252 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'pzfu+ar#2)!-)(ug%hz)*_d@%e@g$%r!k)*doy$8imp&26!n$o'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'course.apps.CourseConfig',
'django.contrib.admin',
'django.contrib.auth',
'd... | true | true |
1c3f414f148b99f54adabdd14a531a20e819bfe9 | 863 | py | Python | ooobuild/dyn/configuration/default_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/configuration/default_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/configuration/default_provider.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 33.192308 | 83 | 0.763615 |
from ...lo.configuration.default_provider import DefaultProvider as DefaultProvider
__all__ = ['DefaultProvider']
| true | true |
1c3f421debe446f13f349bd6fae64340c34dcb36 | 1,677 | py | Python | setup.py | kikitrade/dubbo-python3 | c8f721d2b7e73909f283c7cdca3b5449892ca400 | [
"Apache-2.0"
] | null | null | null | setup.py | kikitrade/dubbo-python3 | c8f721d2b7e73909f283c7cdca3b5449892ca400 | [
"Apache-2.0"
] | null | null | null | setup.py | kikitrade/dubbo-python3 | c8f721d2b7e73909f283c7cdca3b5449892ca400 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
... | 35.680851 | 75 | 0.670841 |
from setuptools import setup, find_packages
setup(
name='dubbo-python3',
version='1.0.3',
url='https://github.com/kikitrade/dubbo-python3',
author='holly',
author_email='hao.holly@gmail.com',
description='Python3 Dubbo Client.',
license='Apache License 2.0',
packages=find_packages(excl... | true | true |
1c3f422e6389aefe6aac0be4a15ed6fdbe434335 | 11,028 | py | Python | pygmt/src/project.py | Test-Organization-6/pygmt | 0aa04d79dfd5d1aeaec9e4b2e4b43850bd6c0299 | [
"BSD-3-Clause"
] | null | null | null | pygmt/src/project.py | Test-Organization-6/pygmt | 0aa04d79dfd5d1aeaec9e4b2e4b43850bd6c0299 | [
"BSD-3-Clause"
] | null | null | null | pygmt/src/project.py | Test-Organization-6/pygmt | 0aa04d79dfd5d1aeaec9e4b2e4b43850bd6c0299 | [
"BSD-3-Clause"
] | null | null | null | """
project - Project data onto lines or great circles, or generate tracks.
"""
import pandas as pd
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
GMTTempFile,
build_arg_string,
fmt_docstring,
kwargs_to_strings,
use_alias,
)
@fmt_docstring
@... | 43.247059 | 88 | 0.622416 | import pandas as pd
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
GMTTempFile,
build_arg_string,
fmt_docstring,
kwargs_to_strings,
use_alias,
)
@fmt_docstring
@use_alias(
A="azimuth",
C="center",
E="endpoint",
F="convention"... | true | true |
1c3f434c07380dbc6d20fcddd44cfbd2e197eca8 | 14,185 | py | Python | napari/_qt/dialogs/preferences_dialog.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/preferences_dialog.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | napari/_qt/dialogs/preferences_dialog.py | marlene09/napari | d3284b5df2efc0fad2664f954cbc52cca9daa105 | [
"BSD-3-Clause"
] | null | null | null | import json
from qtpy.QtCore import QSize, Signal
from qtpy.QtWidgets import (
QDialog,
QHBoxLayout,
QListWidget,
QPushButton,
QStackedWidget,
QVBoxLayout,
)
from ..._vendor.qt_json_builder.qt_jsonschema_form import WidgetBuilder
from ...utils.settings import get_settings
from ...utils.transla... | 34.513382 | 97 | 0.585407 | import json
from qtpy.QtCore import QSize, Signal
from qtpy.QtWidgets import (
QDialog,
QHBoxLayout,
QListWidget,
QPushButton,
QStackedWidget,
QVBoxLayout,
)
from ..._vendor.qt_json_builder.qt_jsonschema_form import WidgetBuilder
from ...utils.settings import get_settings
from ...utils.transla... | true | true |
1c3f43546d2c6e7b55e1780c060faf8bc8c3afc1 | 636 | py | Python | backend/manage.py | crowdbotics-apps/muddy-term-29546 | 6e530c79087dbd3657982886fc0fe77de21f4adc | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/muddy-term-29546 | 6e530c79087dbd3657982886fc0fe77de21f4adc | [
"FTL",
"AML",
"RSA-MD"
] | 42 | 2021-08-06T02:56:25.000Z | 2021-12-26T17:40:42.000Z | backend/manage.py | crowdbotics-apps/muddy-term-29546 | 6e530c79087dbd3657982886fc0fe77de21f4adc | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'muddy_term_29546.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rai... | 28.909091 | 80 | 0.687107 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'muddy_term_29546.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and... | true | true |
1c3f440a7420883459bb7d4819ae2fbbb608a658 | 425 | py | Python | src/girard/series_convergence.py | gnsantos/solidus | ea4ffcf391ee0e9cf775b984a1aa6776c55ae67e | [
"Apache-2.0"
] | null | null | null | src/girard/series_convergence.py | gnsantos/solidus | ea4ffcf391ee0e9cf775b984a1aa6776c55ae67e | [
"Apache-2.0"
] | null | null | null | src/girard/series_convergence.py | gnsantos/solidus | ea4ffcf391ee0e9cf775b984a1aa6776c55ae67e | [
"Apache-2.0"
] | null | null | null | import numpy as np
def convergence_matrix(spanning_matrix):
grammian_matrix = spanning_matrix.T * spanning_matrix
cm = (-1) * grammian_matrix
np.fill_diagonal(cm, 1)
return cm
def check_convergence(spanning_matrix):
matrix_for_convergence = convergence_matrix(spanning_matrix)
convergence_matri... | 32.692308 | 74 | 0.785882 | import numpy as np
def convergence_matrix(spanning_matrix):
grammian_matrix = spanning_matrix.T * spanning_matrix
cm = (-1) * grammian_matrix
np.fill_diagonal(cm, 1)
return cm
def check_convergence(spanning_matrix):
matrix_for_convergence = convergence_matrix(spanning_matrix)
convergence_matri... | true | true |
1c3f443cdb3a48c534a1d5fa069ce25e9b56958e | 2,812 | py | Python | OPTOSTools/Visualization_CNN/Print_Features.py | Vengadore/Segmentation_OPTOS | d15b6480a567c987b10f7bf680672356e68b7e5b | [
"Apache-2.0"
] | 1 | 2020-10-31T21:01:26.000Z | 2020-10-31T21:01:26.000Z | OPTOSTools/Visualization_CNN/Print_Features.py | Vengadore/Segmentation_OPTOS | d15b6480a567c987b10f7bf680672356e68b7e5b | [
"Apache-2.0"
] | null | null | null | OPTOSTools/Visualization_CNN/Print_Features.py | Vengadore/Segmentation_OPTOS | d15b6480a567c987b10f7bf680672356e68b7e5b | [
"Apache-2.0"
] | null | null | null | import cv2
from tensorflow.keras.models import Model
class Model_CNN:
""" Model_CNN(model)
- Reads a CNN model and looks in the name of the layers for "conv", if found it is saved as an index for extracting feature maps.
model: CNN model to extract feature maps from.
"""
def __init__(s... | 34.716049 | 137 | 0.625178 | import cv2
from tensorflow.keras.models import Model
class Model_CNN:
def __init__(self,model):
self.model = model
self.conv_index = [ind for (ind,layer) in enumerate(model.layers) if "conv" in layer.name]
self.conv_shapes = [(ind,model.layers[ind].name,model.layers... | true | true |
1c3f444859a21cabd7337ae0ebbff4509045aa69 | 505 | py | Python | servio-backend-app/servio/user/migrations/0007_alter_user_service.py | emreerkaslan/SWE573 | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | null | null | null | servio-backend-app/servio/user/migrations/0007_alter_user_service.py | emreerkaslan/SWE573 | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | 19 | 2021-10-21T12:43:36.000Z | 2021-12-05T14:21:55.000Z | servio-backend-app/servio/user/migrations/0007_alter_user_service.py | emreerkaslan/Servio | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-01-02 13:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service', '0004_alter_service_requests'),
('user', '0006_alter_user_feedbacks_alter_user_following'),
]
operations = [
migrations.Alte... | 25.25 | 100 | 0.637624 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('service', '0004_alter_service_requests'),
('user', '0006_alter_user_feedbacks_alter_user_following'),
]
operations = [
migrations.AlterField(
model_name='user',
... | true | true |
1c3f45dbc1e43153985a7940de0973749caed8f1 | 8,176 | py | Python | examples/basic-tour.py | se-hwan/dynamicCostMPC | f461fe1f9c23783db53dbfe362a26fb33c20a695 | [
"MIT"
] | null | null | null | examples/basic-tour.py | se-hwan/dynamicCostMPC | f461fe1f9c23783db53dbfe362a26fb33c20a695 | [
"MIT"
] | null | null | null | examples/basic-tour.py | se-hwan/dynamicCostMPC | f461fe1f9c23783db53dbfe362a26fb33c20a695 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Basic tour of the Bayesian Optimization package
#
# This is a constrained global optimization package built upon bayesian inference and gaussian process, that attempts to find the maximum value of an unknown function in as few iterations as possible. This technique is particu... | 35.090129 | 558 | 0.74841 |
def black_box_function(x, y):
return -x ** 2 - (y - 1) ** 2 + 1
from bayes_opt import BayesianOptimization
pbounds = {'x': (2, 4), 'y': (-3, 3)}
optimizer = BayesianOptimization(
f=black_box_function,
pbounds=pbounds,
verbose=2, random_state=1,
)
optimizer.maximize(
init_p... | true | true |
1c3f472f9aa622d94beff234a175e42926e0ed64 | 2,813 | py | Python | testing/__init__.py | weltonrodrigo/dumb-init | a0e0776bec98e9a332385b5c320f978b67db193e | [
"MIT"
] | null | null | null | testing/__init__.py | weltonrodrigo/dumb-init | a0e0776bec98e9a332385b5c320f978b67db193e | [
"MIT"
] | null | null | null | testing/__init__.py | weltonrodrigo/dumb-init | a0e0776bec98e9a332385b5c320f978b67db193e | [
"MIT"
] | null | null | null | import errno
import os
import re
import signal
import sys
import time
from contextlib import contextmanager
from subprocess import PIPE
from subprocess import Popen
from py._path.local import LocalPath
# these signals cause dumb-init to suspend itself
SUSPEND_SIGNALS = frozenset([
signal.SIGTSTP,
signal.SIGT... | 25.116071 | 80 | 0.586562 | import errno
import os
import re
import signal
import sys
import time
from contextlib import contextmanager
from subprocess import PIPE
from subprocess import Popen
from py._path.local import LocalPath
SUSPEND_SIGNALS = frozenset([
signal.SIGTSTP,
signal.SIGTTOU,
signal.SIGTTIN,
])
NORMAL_SIGNALS = froz... | true | true |
1c3f475195fe3b3bf6ec44debfc1ea20d2c4a46b | 132 | py | Python | Operator and String/3.5.3.py | ferrerinicolas/python_samples | 107cead4fbee30b275a5e2be1257833129ce5e46 | [
"MIT"
] | null | null | null | Operator and String/3.5.3.py | ferrerinicolas/python_samples | 107cead4fbee30b275a5e2be1257833129ce5e46 | [
"MIT"
] | null | null | null | Operator and String/3.5.3.py | ferrerinicolas/python_samples | 107cead4fbee30b275a5e2be1257833129ce5e46 | [
"MIT"
] | null | null | null | print("hello " + ", world!")
print("a" + "b" + "c")
print("hi" * 3)
print("hi" + str(3))
print("My bike has " + str(6) + " gears.") | 22 | 42 | 0.492424 | print("hello " + ", world!")
print("a" + "b" + "c")
print("hi" * 3)
print("hi" + str(3))
print("My bike has " + str(6) + " gears.") | true | true |
1c3f47f1ed2669ba90d5a94b8c0f1e2af675c37d | 4,933 | py | Python | Message/InfoMessage_pb2.py | qikkDB/qikkdb-python-network-client | 3e5c6ed3e13957dbc16b5bf9fdefe92e5cf054d3 | [
"Apache-2.0"
] | 5 | 2020-06-30T11:55:26.000Z | 2021-04-24T00:05:35.000Z | Message/InfoMessage_pb2.py | qikkDB/qikkdb-python-network-client | 3e5c6ed3e13957dbc16b5bf9fdefe92e5cf054d3 | [
"Apache-2.0"
] | null | null | null | Message/InfoMessage_pb2.py | qikkDB/qikkdb-python-network-client | 3e5c6ed3e13957dbc16b5bf9fdefe92e5cf054d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Message/InfoMessage.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database ... | 36.272059 | 540 | 0.759376 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='Message/... | true | true |
1c3f4846e299df5f15a74d0917ad5deaac68416d | 3,827 | bzl | Python | kythe/cxx/extractor/proto/testdata/proto_extractor_test.bzl | bef0/kythe | 2adcb540ae9dbd61879315a5ade8d3716ee3d3d8 | [
"Apache-2.0"
] | null | null | null | kythe/cxx/extractor/proto/testdata/proto_extractor_test.bzl | bef0/kythe | 2adcb540ae9dbd61879315a5ade8d3716ee3d3d8 | [
"Apache-2.0"
] | null | null | null | kythe/cxx/extractor/proto/testdata/proto_extractor_test.bzl | bef0/kythe | 2adcb540ae9dbd61879315a5ade8d3716ee3d3d8 | [
"Apache-2.0"
] | null | null | null | """Rules for testing the proto extractor"""
# Copyright 2018 The Kythe Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 31.891667 | 92 | 0.617455 |
load("@bazel_skylib//lib:dicts.bzl", "dicts")
def _extract_kzip_impl(ctx):
cmd = [ctx.executable.extractor.path] + [p.path for p in ctx.files.srcs] + ctx.attr.opts
ctx.actions.run_shell(
mnemonic = "Extract",
command = " ".join(cmd),
env = dicts.add(ctx.attr.extra_env, {"KYTHE_OUTPUT_... | true | true |
1c3f48aae9ca9fd09823987c78cc87743fd28899 | 13,330 | py | Python | kubernetes_asyncio/client/models/v1_node_system_info.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_node_system_info.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_node_system_info.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1NodeSyst... | 35.35809 | 267 | 0.64051 |
import pprint
import re
import six
class V1NodeSystemInfo(object):
openapi_types = {
'architecture': 'str',
'boot_id': 'str',
'container_runtime_version': 'str',
'kernel_version': 'str',
'kube_proxy_version': 'str',
'kubelet_version': 'str',
'machine_i... | true | true |
1c3f49404e6dd0c5ad52a00fb049a2addc5ae17b | 725 | py | Python | udsoncan/configs.py | marchcui/pythUDS | 3012c716299730c23f58d7e545d5bb22f301d1c7 | [
"MIT"
] | null | null | null | udsoncan/configs.py | marchcui/pythUDS | 3012c716299730c23f58d7e545d5bb22f301d1c7 | [
"MIT"
] | null | null | null | udsoncan/configs.py | marchcui/pythUDS | 3012c716299730c23f58d7e545d5bb22f301d1c7 | [
"MIT"
] | null | null | null | default_client_config = {
'exception_on_negative_response' : True,
'exception_on_invalid_response' : True,
'exception_on_unexpected_response' : True,
'security_algo' : None,
'security_algo_params' : None,
'tolerate_zero_padding' : True,
'ignore_all_zero_dt... | 40.277778 | 106 | 0.594483 | default_client_config = {
'exception_on_negative_response' : True,
'exception_on_invalid_response' : True,
'exception_on_unexpected_response' : True,
'security_algo' : None,
'security_algo_params' : None,
'tolerate_zero_padding' : True,
'ignore_all_zero_dt... | true | true |
1c3f49ed42a717f7d956ed34ca2195e2690c3b1b | 2,118 | py | Python | tests/test_plugin_collector.py | AdamGleave/pytest-notebook | 94df07bb0138bc677de9842aca8f5acd44c58677 | [
"BSD-3-Clause"
] | null | null | null | tests/test_plugin_collector.py | AdamGleave/pytest-notebook | 94df07bb0138bc677de9842aca8f5acd44c58677 | [
"BSD-3-Clause"
] | null | null | null | tests/test_plugin_collector.py | AdamGleave/pytest-notebook | 94df07bb0138bc677de9842aca8f5acd44c58677 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Test the plugin collection and direct invocation of notebooks."""
import os
PATH = os.path.dirname(os.path.realpath(__file__))
def copy_nb_to_tempdir(in_name="different_outputs.ipynb", out_name="test_nb.ipynb"):
with open(os.path.join(PATH, "raw_files", in_name), "rb") as handle:
... | 32.584615 | 84 | 0.655807 | import os
PATH = os.path.dirname(os.path.realpath(__file__))
def copy_nb_to_tempdir(in_name="different_outputs.ipynb", out_name="test_nb.ipynb"):
with open(os.path.join(PATH, "raw_files", in_name), "rb") as handle:
data = handle.read()
with open(out_name, "wb") as handle:
handle.write(data)
... | true | true |
1c3f4a8ff00b30d0100ea2e67dc64c1c4a865a9a | 662 | py | Python | setup.py | JartC0ding/Encrypto | 1a094b8e657d48d335b1b9a2d419edbd311e1cc9 | [
"Apache-2.0"
] | null | null | null | setup.py | JartC0ding/Encrypto | 1a094b8e657d48d335b1b9a2d419edbd311e1cc9 | [
"Apache-2.0"
] | null | null | null | setup.py | JartC0ding/Encrypto | 1a094b8e657d48d335b1b9a2d419edbd311e1cc9 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Operating System :: Microsoft :: Windows :: Windows 10",
"License :: Apache License 2.0",
"Programming Language :: Python :: 3"
]
setup(
name="Encrypto",
vers... | 26.48 | 59 | 0.676737 | from setuptools import setup, find_packages
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Education",
"Operating System :: Microsoft :: Windows :: Windows 10",
"License :: Apache License 2.0",
"Programming Language :: Python :: 3"
]
setup(
name="Encrypto",
vers... | true | true |
1c3f4b0354fb050dc4cc0435b92018ab52be6e22 | 477 | py | Python | wooey/__init__.py | 8dspaces/Wooey-Flask | 44d3ce02474859cdd8d6f1138ba48ce62b739524 | [
"BSD-3-Clause"
] | 1 | 2020-11-05T15:04:33.000Z | 2020-11-05T15:04:33.000Z | wooey/__init__.py | 8dspaces/Wooey-Flask | 44d3ce02474859cdd8d6f1138ba48ce62b739524 | [
"BSD-3-Clause"
] | null | null | null | wooey/__init__.py | 8dspaces/Wooey-Flask | 44d3ce02474859cdd8d6f1138ba48ce62b739524 | [
"BSD-3-Clause"
] | null | null | null | from . import version
import os
if version.DJANGO_VERSION >= version.DJ17:
default_app_config = 'wooey.apps.WooeyConfig'
else:
if os.environ.get('TESTING') != 'True':
from . import settings as wooey_settings
# we need to call from within wooey_settings so the celery/etc vars are setup
if... | 36.692308 | 85 | 0.69392 | from . import version
import os
if version.DJANGO_VERSION >= version.DJ17:
default_app_config = 'wooey.apps.WooeyConfig'
else:
if os.environ.get('TESTING') != 'True':
from . import settings as wooey_settings
if not wooey_settings.settings.configured:
wooey_settings.settings.c... | true | true |
1c3f4c8e6de51b62e6abfebe7b9516db38d53f2d | 279 | py | Python | tests/test_run_times/__init__.py | James-Montgomery/platea | 96188d34293d46ddc3f9935fe1349f83f72c13a8 | [
"MIT"
] | null | null | null | tests/test_run_times/__init__.py | James-Montgomery/platea | 96188d34293d46ddc3f9935fe1349f83f72c13a8 | [
"MIT"
] | null | null | null | tests/test_run_times/__init__.py | James-Montgomery/platea | 96188d34293d46ddc3f9935fe1349f83f72c13a8 | [
"MIT"
] | null | null | null | """
Run Times
=====
Run time evaluation of functions in Platea.
"""
# # Example of per line run time diagnostic
# import cProfile
# import platea.random_number_generators as rng
# ran = rng.Ran0(seed=-99999)
# ran_draw = ran.draw
# cProfile.run("ran_draw(100000)", sort="time")
| 21.461538 | 47 | 0.713262 | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.