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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74330205dc18959c1fd7250558145997a98f940 | 947 | py | Python | Chapter05/Ch5/ttk_inheritance.py | henrryyanez/Tkinter-GUI-Programming-by-Example | c8a326d6034b5e54f77605a8ec840cb8fac89412 | [
"MIT"
] | 127 | 2018-08-27T16:34:43.000Z | 2022-03-22T19:20:53.000Z | Chapter05/Ch5/ttk_inheritance.py | PiotrAdaszewski/Tkinter-GUI-Programming-by-Example | c8a326d6034b5e54f77605a8ec840cb8fac89412 | [
"MIT"
] | 8 | 2019-04-11T06:47:36.000Z | 2022-03-11T23:23:42.000Z | Chapter05/Ch5/ttk_inheritance.py | PiotrAdaszewski/Tkinter-GUI-Programming-by-Example | c8a326d6034b5e54f77605a8ec840cb8fac89412 | [
"MIT"
] | 85 | 2018-04-30T19:42:21.000Z | 2022-03-30T01:22:54.000Z | import tkinter as tk
import tkinter.ttk as ttk
win = tk.Tk()
regular_button = ttk.Button(win, text="regular button")
small_button = ttk.Button(win, text="small button", style="small.TButton")
big_button = ttk.Button(win, text="big button", style="big.TButton")
big_dangerous_button = ttk.Button(win, text="big dangerou... | 35.074074 | 94 | 0.757128 | import tkinter as tk
import tkinter.ttk as ttk
win = tk.Tk()
regular_button = ttk.Button(win, text="regular button")
small_button = ttk.Button(win, text="small button", style="small.TButton")
big_button = ttk.Button(win, text="big button", style="big.TButton")
big_dangerous_button = ttk.Button(win, text="big dangerou... | true | true |
f74330548ced070405f5f5c076c1295da1b38200 | 1,200 | py | Python | Exercises/6.9.py | patcharinka/15016406 | 6d1adcdb727bdd329c26455dc21706a4e9fa725a | [
"MIT"
] | null | null | null | Exercises/6.9.py | patcharinka/15016406 | 6d1adcdb727bdd329c26455dc21706a4e9fa725a | [
"MIT"
] | 1 | 2021-05-10T15:35:21.000Z | 2021-05-10T15:35:21.000Z | Exercises/6.9.py | patcharinka/15016406 | 6d1adcdb727bdd329c26455dc21706a4e9fa725a | [
"MIT"
] | null | null | null | """
File: newton.py
Project 6.9
Compute the square root of a number (uses recursive function with
default second parameter).
1. The input is a number, or enter/return to halt the
input process.
2. The outputs are the program's estimate of the square root
using Newton's method of successive approximations, and
... | 26.666667 | 70 | 0.643333 |
import math
TOLERANCE = 0.000001
def newton(x, estimate = 1):
difference = abs(x - estimate ** 2)
if difference <= TOLERANCE:
return estimate
else:
return newton(x, (estimate + x / estimate) / 2)
def main():
while True:
x = input("Enter a positive numb... | true | true |
f743307582463013b864243ea812d8afd7924c97 | 1,468 | py | Python | recirq/qml_lfe/state_flags.py | Coiner1909/ReCirq | dc52158bf02697c0b0f3022829f0df78665cfcc6 | [
"Apache-2.0"
] | 1 | 2022-02-25T10:37:25.000Z | 2022-02-25T10:37:25.000Z | recirq/qml_lfe/state_flags.py | Coiner1909/ReCirq | dc52158bf02697c0b0f3022829f0df78665cfcc6 | [
"Apache-2.0"
] | null | null | null | recirq/qml_lfe/state_flags.py | Coiner1909/ReCirq | dc52158bf02697c0b0f3022829f0df78665cfcc6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 31.913043 | 90 | 0.741826 |
from absl import flags
FLAGS = flags.FLAGS
flags.DEFINE_integer("n", None, "Number of qubits to use.")
flags.DEFINE_integer(
"n_paulis", 20, "Number of random Pauli string circuits to generate."
)
flags.DEFINE_integer(
"n_sweeps",
500,
"Number of sweeps to send over the wire per cir... | true | true |
f743320bd23abb095170062a1945073683692091 | 484 | py | Python | scripts/portal/rankRoom.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 2 | 2020-04-15T03:16:07.000Z | 2020-08-12T23:28:32.000Z | scripts/portal/rankRoom.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | null | null | null | scripts/portal/rankRoom.py | Snewmy/swordie | ae01ed4ec0eb20a18730e8cd209eea0b84a8dd17 | [
"MIT"
] | 3 | 2020-08-25T06:55:25.000Z | 2020-12-01T13:07:43.000Z | fields = {
100000201 : [100000205, 2],
103000003 : [103000008, 1],
102000003 : [102000004, 1],
101000003 : [101000004, 2],
# 120000101 : [100000205, 2],
}
currentMap = sm.getFieldID()
if currentMap == 120000101:# Pirates
sm.chatBlue("[WIP] no MapID for Hall of Pirates")
elif currentMap in fields:
sm.warp(field... | 28.470588 | 103 | 0.681818 | fields = {
100000201 : [100000205, 2],
103000003 : [103000008, 1],
102000003 : [102000004, 1],
101000003 : [101000004, 2],
}
currentMap = sm.getFieldID()
if currentMap == 120000101:
sm.chatBlue("[WIP] no MapID for Hall of Pirates")
elif currentMap in fields:
sm.warp(fields[currentMap][0], fields[currentMap][1... | true | true |
f743328e19cb9b97b8b23b43ed02edf9cd0b1994 | 7,635 | py | Python | chromeperf/src/chromeperf/pinpoint/actions/tests.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | null | null | null | chromeperf/src/chromeperf/pinpoint/actions/tests.py | xswz8015/infra | f956b78ce4c39cc76acdda47601b86794ae0c1ba | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | chromeperf/src/chromeperf/pinpoint/actions/tests.py | NDevTK/chromium-infra | d38e088e158d81f7f2065a38aa1ea1894f735ec4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import dataclasses
import typing
import logging
from google.cloud import datastore
from google.protobuf import json_format
from chromeperf.pinpoint.actions ... | 37.426471 | 80 | 0.601441 |
import dataclasses
import typing
import logging
from google.cloud import datastore
from google.protobuf import json_format
from chromeperf.pinpoint.actions import updates
from chromeperf.pinpoint.models import task as task_module
from chromeperf.pinpoint import test_runner_payload_pb2
from chromeperf.services impo... | true | true |
f743340eece0ee2e154c0f55be983082711030a9 | 11,327 | py | Python | neutron-14.0.1/neutron/common/constants.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | neutron-14.0.1/neutron/common/constants.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | neutron-14.0.1/neutron/common/constants.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 38.658703 | 78 | 0.633531 |
from neutron_lib.api.definitions import l3
from neutron_lib import constants as lib_constants
from neutron_lib.plugins import constants as plugin_consts
ROUTER_PORT_OWNERS = lib_constants.ROUTER_INTERFACE_OWNERS_SNAT + \
(lib_constants.DEVICE_OWNER_ROUTER_GW,)
ROUTER_STATUS_ACTIVE = 'ACTIVE'
ROUTER... | true | true |
f74334c4f0200235ab1c2998ed9d33a89a7dcc5b | 2,065 | py | Python | visual_regression_tracker/types.py | AdamHepner/sdk-python | fb3bd5bbbf3419a8a146ae7cbe9c0bf58feee0ca | [
"Apache-2.0"
] | 2 | 2020-08-17T21:58:18.000Z | 2020-12-28T03:41:19.000Z | visual_regression_tracker/types.py | AdamHepner/sdk-python | fb3bd5bbbf3419a8a146ae7cbe9c0bf58feee0ca | [
"Apache-2.0"
] | 20 | 2020-08-04T01:49:39.000Z | 2021-08-19T09:26:06.000Z | visual_regression_tracker/types.py | AdamHepner/sdk-python | fb3bd5bbbf3419a8a146ae7cbe9c0bf58feee0ca | [
"Apache-2.0"
] | 3 | 2020-08-03T12:16:03.000Z | 2021-08-16T15:10:32.000Z | import dataclasses
import enum
import typing
import dacite
@dataclasses.dataclass
class IgnoreArea:
x: int = None
y: int = None
width: int = None
height: int = None
@dataclasses.dataclass
class TestRun:
name: str = None
imageBase64: str = None
os: str = None
browser: str = None
... | 24.583333 | 107 | 0.687167 | import dataclasses
import enum
import typing
import dacite
@dataclasses.dataclass
class IgnoreArea:
x: int = None
y: int = None
width: int = None
height: int = None
@dataclasses.dataclass
class TestRun:
name: str = None
imageBase64: str = None
os: str = None
browser: str = None
... | true | true |
f743359e6f9d203d480c50a1a8abb0d51e5be80f | 483 | py | Python | user_service/api.py | lewisemm/vistagrid-backend-k8 | 08a4753b12db00962a4be94276b76d32b8304272 | [
"MIT"
] | null | null | null | user_service/api.py | lewisemm/vistagrid-backend-k8 | 08a4753b12db00962a4be94276b76d32b8304272 | [
"MIT"
] | 1 | 2021-02-02T10:23:25.000Z | 2021-02-02T10:23:25.000Z | user_service/api.py | lewisemm/vistagrid-backend-k8 | 08a4753b12db00962a4be94276b76d32b8304272 | [
"MIT"
] | null | null | null | from flask_jwt_extended import JWTManager
from flask_restful import Api
from user_service.application import app
from user_service.resources.user import User as UserResource, UserList
from user_service.resources.auth import UserAuth
api = Api(app)
jwt = JWTManager(app)
@app.route('/')
def hello_world():
return ... | 24.15 | 70 | 0.778468 | from flask_jwt_extended import JWTManager
from flask_restful import Api
from user_service.application import app
from user_service.resources.user import User as UserResource, UserList
from user_service.resources.auth import UserAuth
api = Api(app)
jwt = JWTManager(app)
@app.route('/')
def hello_world():
return ... | true | true |
f74335d098048230bce51e69173b2cf3ac9aebdc | 6,401 | py | Python | updater.py | overworks/tweet-aladin | f6e70cc04c7fed758b343591ebfb1c4f0c55601f | [
"MIT"
] | null | null | null | updater.py | overworks/tweet-aladin | f6e70cc04c7fed758b343591ebfb1c4f0c55601f | [
"MIT"
] | null | null | null | updater.py | overworks/tweet-aladin | f6e70cc04c7fed758b343591ebfb1c4f0c55601f | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding:utf-8 -*-
import os
import os.path
import logging
import logging.handlers
import sqlite3
import tweepy
import requests
from six.moves.urllib.request import urlretrieve
from six.moves.urllib.parse import urlencode
DB_FILENAME = 'aladin.db'
LOG_FILENAME = 'aladin.log'
ALADIN_ITEM_ENDPOI... | 36.577143 | 165 | 0.527105 |
import os
import os.path
import logging
import logging.handlers
import sqlite3
import tweepy
import requests
from six.moves.urllib.request import urlretrieve
from six.moves.urllib.parse import urlencode
DB_FILENAME = 'aladin.db'
LOG_FILENAME = 'aladin.log'
ALADIN_ITEM_ENDPOINT = 'http://www.aladin.co.kr/ttb/api/i... | true | true |
f743373901e66f3daa1521d7218e2abac8c4a375 | 21,266 | py | Python | custom_models_functional.py | ChristianOrr/Real-time-self-adaptive-deep-stereo | 29bbfb212ff7a62769d39f0fe15ecb2f408ac535 | [
"Apache-2.0"
] | 1 | 2021-12-31T18:30:52.000Z | 2021-12-31T18:30:52.000Z | custom_models_functional.py | ChristianOrr/Real-time-self-adaptive-deep-stereo | 29bbfb212ff7a62769d39f0fe15ecb2f408ac535 | [
"Apache-2.0"
] | null | null | null | custom_models_functional.py | ChristianOrr/Real-time-self-adaptive-deep-stereo | 29bbfb212ff7a62769d39f0fe15ecb2f408ac535 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
from keras.engine import data_adapter
from matplotlib import cm
def colorize_img(value, vmin=None, vmax=None, cmap='jet'):
"""
A utility function for TensorFlow that maps a grayscale image to a matplotlib colormap for use with TensorBoard image summaries.
By defa... | 46.432314 | 160 | 0.648218 | import tensorflow as tf
import numpy as np
from keras.engine import data_adapter
from matplotlib import cm
def colorize_img(value, vmin=None, vmax=None, cmap='jet'):
ndices = tf.cast(tf.round(value[:,:,:,0]*255), dtype=tf.int32)
color_map = cm.get_cmap(cmap)
colors = color_map(np.arange(256... | true | true |
f74337b059e17854d2e8e611feb1773156b25eee | 381 | py | Python | es/asgi.py | Kgermando/e-s | 249ada84c63ffe99a71c1fbb301c533b9f5a3869 | [
"Apache-2.0"
] | null | null | null | es/asgi.py | Kgermando/e-s | 249ada84c63ffe99a71c1fbb301c533b9f5a3869 | [
"Apache-2.0"
] | null | null | null | es/asgi.py | Kgermando/e-s | 249ada84c63ffe99a71c1fbb301c533b9f5a3869 | [
"Apache-2.0"
] | null | null | null | """
ASGI config for es project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_M... | 22.411765 | 78 | 0.779528 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'es.settings')
application = get_asgi_application()
| true | true |
f7433bf05b8266b4d1c798bb55c90a5032f7c6ea | 59 | py | Python | connectomics/config/__init__.py | frommwonderland/pytorch_connectomics | 95859ec5257d6991ca64782523637f947a8485e2 | [
"MIT"
] | 99 | 2019-04-22T16:26:05.000Z | 2022-03-15T18:52:57.000Z | connectomics/config/__init__.py | Lauenburg/pytorch_connectomics | c06116343edc65f7c34bcbcc6fe1cff1d9fc579b | [
"MIT"
] | 34 | 2019-05-23T16:40:32.000Z | 2022-03-12T15:41:11.000Z | connectomics/config/__init__.py | Lauenburg/pytorch_connectomics | c06116343edc65f7c34bcbcc6fe1cff1d9fc579b | [
"MIT"
] | 77 | 2019-05-14T12:15:17.000Z | 2022-03-04T10:55:04.000Z | from .defaults import get_cfg_defaults
from .utils import * | 29.5 | 38 | 0.830508 | from .defaults import get_cfg_defaults
from .utils import * | true | true |
f7433bfb3b62884551200d384723a0a25016acf7 | 2,417 | py | Python | .nox/tests/lib/python3.7/site-packages/nashpy/polytope/polytope.py | antonevenepoel/open_spiel | f2f0c786410018675fc40e9a5b82c40814555fa8 | [
"Apache-2.0"
] | null | null | null | .nox/tests/lib/python3.7/site-packages/nashpy/polytope/polytope.py | antonevenepoel/open_spiel | f2f0c786410018675fc40e9a5b82c40814555fa8 | [
"Apache-2.0"
] | null | null | null | .nox/tests/lib/python3.7/site-packages/nashpy/polytope/polytope.py | antonevenepoel/open_spiel | f2f0c786410018675fc40e9a5b82c40814555fa8 | [
"Apache-2.0"
] | null | null | null | """A class for a normal form game"""
from itertools import product
import numpy as np
from scipy.optimize import linprog
from scipy.spatial import HalfspaceIntersection
def build_halfspaces(M):
"""
Build a matrix representation for a halfspace corresponding to:
Mx <= 1 and x >= 0
This is of the... | 22.801887 | 104 | 0.625155 | from itertools import product
import numpy as np
from scipy.optimize import linprog
from scipy.spatial import HalfspaceIntersection
def build_halfspaces(M):
number_of_strategies, dimension = M.shape
b = np.append(-np.ones(number_of_strategies), np.zeros(dimension))
M = np.append(M, -np.eye(dimension), ax... | true | true |
f7433d32a0e9aaa41a4d5b352955bc4ffeaa0ac1 | 8,336 | py | Python | homeassistant/components/flexit/climate.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 1 | 2022-02-21T05:50:41.000Z | 2022-02-21T05:50:41.000Z | homeassistant/components/flexit/climate.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 25 | 2021-10-02T10:01:14.000Z | 2022-03-31T06:11:49.000Z | homeassistant/components/flexit/climate.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 1 | 2021-12-10T10:33:28.000Z | 2021-12-10T10:33:28.000Z | """Platform for Flexit AC units with CI66 Modbus adapter."""
from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.components.climate import (
PLATFORM_SCHEMA,
ClimateEntity,
ClimateEntityFeature,
)
from homeassistant.components.climate.const import HVAC_MODE_COOL
... | 33.079365 | 88 | 0.658349 | from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant.components.climate import (
PLATFORM_SCHEMA,
ClimateEntity,
ClimateEntityFeature,
)
from homeassistant.components.climate.const import HVAC_MODE_COOL
from homeassistant.components.modbus import get_hub
from home... | true | true |
f7433df28833d3268f1fbbd6380a14938b26115f | 15,412 | py | Python | cinder/tests/test_volume_types.py | theanalyst/cinder | 7774eb30802b8cbebab2b7d4b1b9d7cac16ef18c | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_volume_types.py | theanalyst/cinder | 7774eb30802b8cbebab2b7d4b1b9d7cac16ef18c | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_volume_types.py | theanalyst/cinder | 7774eb30802b8cbebab2b7d4b1b9d7cac16ef18c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2011 Zadara Storage Inc.
# Copyright (c) 2011 OpenStack Foundation
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | 48.31348 | 79 | 0.543213 |
import datetime
import time
from cinder import context
from cinder import db
from cinder.db.sqlalchemy import api as db_api
from cinder.db.sqlalchemy import models
from cinder import exception
from cinder.openstack.common import log as logging
from cinder import test
from cinder.tests import conf_fixtur... | true | true |
f7433edcae8ac256949e6b36b7d37f4781d63cd6 | 1,618 | py | Python | src/olymptester/arg_parser.py | jrojer/easy-stdio-tester | e3ecf4261859cc3d7fe93142ed0e0d773cff60ed | [
"MIT"
] | 1 | 2021-09-20T17:02:24.000Z | 2021-09-20T17:02:24.000Z | src/olymptester/arg_parser.py | jrojer/easy-stdio-tester | e3ecf4261859cc3d7fe93142ed0e0d773cff60ed | [
"MIT"
] | 1 | 2021-11-21T14:35:29.000Z | 2021-12-08T17:23:44.000Z | src/olymptester/arg_parser.py | jrojer/easy-stdio-tester | e3ecf4261859cc3d7fe93142ed0e0d773cff60ed | [
"MIT"
] | null | null | null | import pathlib
import argparse
usage_string = '''Welcome to Olymptester!
Usage:
> olymptester run|test|init [-d dirname] [-p path/to/app] [-t path/to/tests]'''
def path(s):
return pathlib.Path(s).absolute()
def validate_paths(d):
if d['mode'] in ['run', 'test']:
workdir = path(d['workdir'... | 31.72549 | 83 | 0.595797 | import pathlib
import argparse
usage_string = '''Welcome to Olymptester!
Usage:
> olymptester run|test|init [-d dirname] [-p path/to/app] [-t path/to/tests]'''
def path(s):
return pathlib.Path(s).absolute()
def validate_paths(d):
if d['mode'] in ['run', 'test']:
workdir = path(d['workdir'... | true | true |
f7433f3f2792e88847f2dce06008770df43a2036 | 8,215 | py | Python | paasta_tools/cli/cmds/rollback.py | white105/paasta | 410418fb54d501141f091381ada368a8bf62037b | [
"Apache-2.0"
] | 2 | 2020-04-09T06:58:46.000Z | 2021-05-03T21:56:03.000Z | paasta_tools/cli/cmds/rollback.py | white105/paasta | 410418fb54d501141f091381ada368a8bf62037b | [
"Apache-2.0"
] | null | null | null | paasta_tools/cli/cmds/rollback.py | white105/paasta | 410418fb54d501141f091381ada368a8bf62037b | [
"Apache-2.0"
] | 1 | 2020-09-29T03:23:02.000Z | 2020-09-29T03:23:02.000Z | #!/usr/bin/env python
# Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 42.786458 | 117 | 0.693609 |
from humanize import naturaltime
from paasta_tools.cli.cmds.mark_for_deployment import mark_for_deployment
from paasta_tools.cli.utils import extract_tags
from paasta_tools.cli.utils import figure_out_service_name
from paasta_tools.cli.utils import lazy_choices_completer
from paasta_tools.cli.utils impor... | true | true |
f7433fcb39e8b8f82ce6db298ad54d6b6fea9cb8 | 4,263 | py | Python | SourceCode/RaspberryPI/bin/mitubishifx5.py | ebarretodev/I2T_IIOT | 7610c623650cdc718c01bfcf5b0caf67493c3cfa | [
"Apache-2.0"
] | 1 | 2021-07-31T19:28:12.000Z | 2021-07-31T19:28:12.000Z | SourceCode/RaspberryPI/bin/mitubishifx5.py | ebarretodev/I2T_IIOT | 7610c623650cdc718c01bfcf5b0caf67493c3cfa | [
"Apache-2.0"
] | 1 | 2020-11-20T18:32:31.000Z | 2020-11-20T18:53:32.000Z | SourceCode/RaspberryPI/bin/mitubishifx5.py | ebarretodev/I2T_IIOT | 7610c623650cdc718c01bfcf5b0caf67493c3cfa | [
"Apache-2.0"
] | null | null | null | import socket
from time import sleep
class PLC():
def __init__(self, typePLC, IP_address, Port):
self.typePLC = typePLC
self.dest = (IP_address, Port)
self._setPLC()
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
subheader = '5000'
network_number = '00'
destinat... | 32.295455 | 172 | 0.579639 | import socket
from time import sleep
class PLC():
def __init__(self, typePLC, IP_address, Port):
self.typePLC = typePLC
self.dest = (IP_address, Port)
self._setPLC()
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
subheader = '5000'
network_number = '00'
destinat... | true | true |
f7434015555d14398b42a2e17248d24fce1f3e81 | 6,792 | py | Python | knockpy/kpytorch/deeppink.py | amspector100/knockpy | c4980ebd506c110473babd85836dbd8ae1d548b7 | [
"MIT"
] | 12 | 2020-12-15T03:15:56.000Z | 2022-02-26T09:56:20.000Z | knockpy/kpytorch/deeppink.py | amspector100/knockpy | c4980ebd506c110473babd85836dbd8ae1d548b7 | [
"MIT"
] | 1 | 2021-05-12T22:51:29.000Z | 2021-05-15T05:42:03.000Z | knockpy/kpytorch/deeppink.py | amspector100/knockpy | c4980ebd506c110473babd85836dbd8ae1d548b7 | [
"MIT"
] | null | null | null | import warnings
import numpy as np
import scipy as sp
from scipy import stats
import torch
import torch.nn as nn
import torch.nn.functional as F
from .. import utilities
def create_batches(features, y, batchsize):
# Create random indices to reorder datapoints
n = features.shape[0]
p = features.shape[1]
... | 31.155963 | 87 | 0.58245 | import warnings
import numpy as np
import scipy as sp
from scipy import stats
import torch
import torch.nn as nn
import torch.nn.functional as F
from .. import utilities
def create_batches(features, y, batchsize):
n = features.shape[0]
p = features.shape[1]
inds = torch.randperm(n)
i = 0
... | true | true |
f74340773a9b92019d9c95b57749007d14d5f72f | 1,946 | py | Python | clustering/agglomerative_clustering.py | netoaraujjo/hal | 0cd66d5548659c4dde70381ad21ba5b9d8213365 | [
"MIT"
] | null | null | null | clustering/agglomerative_clustering.py | netoaraujjo/hal | 0cd66d5548659c4dde70381ad21ba5b9d8213365 | [
"MIT"
] | null | null | null | clustering/agglomerative_clustering.py | netoaraujjo/hal | 0cd66d5548659c4dde70381ad21ba5b9d8213365 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
import numpy as np
from sklearn.cluster import AgglomerativeClustering as sk_AgglomerativeClustering
from sklearn.externals.joblib import Memory
from .clustering import Clustering
class AgglomerativeClustering(Clustering):
"""docstring for AgglomerativeClustering."""
def __init__(self, d... | 36.037037 | 88 | 0.593011 |
import numpy as np
from sklearn.cluster import AgglomerativeClustering as sk_AgglomerativeClustering
from sklearn.externals.joblib import Memory
from .clustering import Clustering
class AgglomerativeClustering(Clustering):
def __init__(self, data, n_clusters = 2, affinity = 'euclidean',
memory = ... | true | true |
f74340d22037dead4b21e2f6ff860fd2a8264176 | 4,793 | py | Python | sysinv/sysinv/sysinv/sysinv/puppet/inventory.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 10 | 2020-02-07T18:57:44.000Z | 2021-09-11T10:29:34.000Z | sysinv/sysinv/sysinv/sysinv/puppet/inventory.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:01:55.000Z | 2021-01-14T12:01:55.000Z | sysinv/sysinv/sysinv/sysinv/puppet/inventory.py | albailey/config | 40ebe63d7dfc6a0a03216ebe55ed3ec9cf5410b9 | [
"Apache-2.0"
] | 10 | 2020-10-13T08:37:46.000Z | 2022-02-09T00:21:25.000Z | #
# Copyright (c) 2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from sysinv.puppet import openstack
from sysinv.common import constants
class SystemInventoryPuppet(openstack.OpenstackBasePuppet):
"""Class to encapsulate puppet operations for sysinv configuration"""
SERVICE_NAME = ... | 40.277311 | 91 | 0.63864 |
from sysinv.puppet import openstack
from sysinv.common import constants
class SystemInventoryPuppet(openstack.OpenstackBasePuppet):
SERVICE_NAME = 'sysinv'
SERVICE_PORT = 6385
SERVICE_PATH = 'v1'
OPENSTACK_KEYRING_SERVICE = 'CGCS'
def get_static_config(self):
dbuser = self._get_d... | true | true |
f74341224e779305f31e00e829e6b63b1d662d88 | 272 | py | Python | embedding/embedding_base.py | zhufz/nlp_research | b435319858520edcca7c0320dca3e0013087c276 | [
"MIT"
] | 160 | 2019-06-21T03:52:48.000Z | 2022-03-07T07:10:11.000Z | embedding/embedding_base.py | zfz1015/nlp_research | b435319858520edcca7c0320dca3e0013087c276 | [
"MIT"
] | 1 | 2021-01-05T02:30:44.000Z | 2021-01-05T02:30:44.000Z | embedding/embedding_base.py | zhufz/nlp_research | b435319858520edcca7c0320dca3e0013087c276 | [
"MIT"
] | 45 | 2019-06-29T09:53:54.000Z | 2022-01-03T07:13:31.000Z | #-*- coding:utf-8 -*-
#所有encoder的基类
import copy
class Base(object):
def __init__(self, **kwargs):
pass
def embed_fun(self, text_id, name = 'base_embedding', **kwargs):
input_dict = {}
input_dict[name] = text_id
return input_dict
| 20.923077 | 68 | 0.610294 |
import copy
class Base(object):
def __init__(self, **kwargs):
pass
def embed_fun(self, text_id, name = 'base_embedding', **kwargs):
input_dict = {}
input_dict[name] = text_id
return input_dict
| true | true |
f743412a270ea18a15bba162153ed3fbd1064e64 | 1,274 | py | Python | DATA_SORT/3cities/SCAM/weakerrelaxation/outputcesmscam_TREFHT_SNOWDa_CLM5F_002.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/SCAM/weakerrelaxation/outputcesmscam_TREFHT_SNOWDa_CLM5F_002.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | DATA_SORT/3cities/SCAM/weakerrelaxation/outputcesmscam_TREFHT_SNOWDa_CLM5F_002.py | islasimpson/snowpaper_2022 | d6ee677f696d7fd6e7cadef8168ce4fd8b184cac | [
"Apache-2.0"
] | null | null | null | import importlib
import xarray as xr
import numpy as np
import pandas as pd
import sys
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
expname=['SASK_SNOWDa_CLM5F_02.0... | 30.333333 | 91 | 0.702512 | import importlib
import xarray as xr
import numpy as np
import pandas as pd
import sys
from CASutils import filter_utils as filt
from CASutils import readdata_utils as read
from CASutils import calendar_utils as cal
importlib.reload(filt)
importlib.reload(read)
importlib.reload(cal)
expname=['SASK_SNOWDa_CLM5F_02.0... | true | true |
f7434132bee2d00304fd9c1c982a7308611a22db | 26,178 | py | Python | qiskit/quantum_info/states/statevector.py | renier/qiskit-terra | 1f5e4c8f6768dfac5d68f39e9d38fdd783ba1346 | [
"Apache-2.0"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | qiskit/quantum_info/states/statevector.py | renier/qiskit-terra | 1f5e4c8f6768dfac5d68f39e9d38fdd783ba1346 | [
"Apache-2.0"
] | 4 | 2020-11-27T09:34:13.000Z | 2021-04-30T21:13:41.000Z | qiskit/quantum_info/states/statevector.py | renier/qiskit-terra | 1f5e4c8f6768dfac5d68f39e9d38fdd783ba1346 | [
"Apache-2.0"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 37.774892 | 96 | 0.582779 |
import copy
import re
import warnings
from numbers import Number
import numpy as np
from qiskit.circuit.quantumcircuit import QuantumCircuit
from qiskit.circuit.instruction import Instruction
from qiskit.exceptions import QiskitError
from qiskit.quantum_info.states.quantum_state import QuantumState
from ... | true | true |
f743414c6b905bfc5b206a721c500d6392894913 | 2,382 | py | Python | infra/build/developer-tools/build/scripts/gh_lint_comment.py | rafaelcavazin/cloud-foundation-toolkit | 7c63dccd4a4cad1d8cd08a146e241a48fc08d41b | [
"Apache-2.0"
] | 688 | 2019-04-02T23:25:41.000Z | 2022-03-30T14:44:18.000Z | infra/build/developer-tools/build/scripts/gh_lint_comment.py | rafaelcavazin/cloud-foundation-toolkit | 7c63dccd4a4cad1d8cd08a146e241a48fc08d41b | [
"Apache-2.0"
] | 620 | 2019-04-03T08:23:49.000Z | 2022-03-30T15:18:46.000Z | infra/build/developer-tools/build/scripts/gh_lint_comment.py | rafaelcavazin/cloud-foundation-toolkit | 7c63dccd4a4cad1d8cd08a146e241a48fc08d41b | [
"Apache-2.0"
] | 390 | 2019-04-03T07:51:30.000Z | 2022-03-26T07:14:35.000Z | import logging
import os
import argparse
from github import Github, GithubException
"""Creates new comment or updates existing comment on a PR using a PAT token"""
def create_update_comment(token, org, repo_name, pr_number, comment_body):
"""Creates or updates existing comment on a PR"""
# auth with GH token
... | 41.789474 | 148 | 0.693115 | import logging
import os
import argparse
from github import Github, GithubException
def create_update_comment(token, org, repo_name, pr_number, comment_body):
gh = Github(token)
github_repo = gh.get_repo(f'{org}/{repo_name}')
current_bot_user = gh.get_user().id
logging.info(f'Current bo... | true | true |
f7434210662f1d0370d2bab8f63d2ad1127181c0 | 387 | py | Python | python/yuewen/venv/Scripts/pip3-script.py | VPoplar/owner_gh | 2449efbb8a8520215dfd9e15157e173344db01fb | [
"Apache-2.0"
] | null | null | null | python/yuewen/venv/Scripts/pip3-script.py | VPoplar/owner_gh | 2449efbb8a8520215dfd9e15157e173344db01fb | [
"Apache-2.0"
] | 5 | 2022-01-15T02:14:49.000Z | 2022-02-27T06:01:47.000Z | python/yuewen/venv/Scripts/pip3-script.py | VPoplar/owner_gh | 2449efbb8a8520215dfd9e15157e173344db01fb | [
"Apache-2.0"
] | null | null | null | #!E:\pyproject\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
... | 29.769231 | 69 | 0.656331 |
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==10.0.1', 'console_scripts', 'pip3')()
)
| true | true |
f74342ffe4940aa7000f059630df95e51dda0eaf | 1,867 | py | Python | 2019/8/8.py | pshatov/AoC | 2417d3b38798d9cb1ff05aad866136cd9b50e6e6 | [
"Unlicense"
] | null | null | null | 2019/8/8.py | pshatov/AoC | 2417d3b38798d9cb1ff05aad866136cd9b50e6e6 | [
"Unlicense"
] | null | null | null | 2019/8/8.py | pshatov/AoC | 2417d3b38798d9cb1ff05aad866136cd9b50e6e6 | [
"Unlicense"
] | null | null | null | with open('input.txt') as f:
img_data = f.readline().strip()
img_w = 25
img_h = 6
layer_num_pixels = img_w * img_h
img_num_layers = len(img_data) // layer_num_pixels
print("img_num_layers = %d" % img_num_layers)
layer_data = []
for i in range(img_num_layers):
a, b = layer_num_pixels*i, layer_num_pixels*(i+1... | 28.723077 | 99 | 0.662025 | with open('input.txt') as f:
img_data = f.readline().strip()
img_w = 25
img_h = 6
layer_num_pixels = img_w * img_h
img_num_layers = len(img_data) // layer_num_pixels
print("img_num_layers = %d" % img_num_layers)
layer_data = []
for i in range(img_num_layers):
a, b = layer_num_pixels*i, layer_num_pixels*(i+1... | true | true |
f74343039851b4c424202bc9359da5a0b0399275 | 113 | py | Python | discordtxt/__init__.py | yo56789/discord.txt | 72788663801b61b49f3d44dbba5da29c976d37de | [
"MIT"
] | null | null | null | discordtxt/__init__.py | yo56789/discord.txt | 72788663801b61b49f3d44dbba5da29c976d37de | [
"MIT"
] | null | null | null | discordtxt/__init__.py | yo56789/discord.txt | 72788663801b61b49f3d44dbba5da29c976d37de | [
"MIT"
] | null | null | null | from .client import Client
__author__ = ".Yo"
__title__ = "discordtxt"
__license__ = "MIT"
__version__ = "1.0.0" | 18.833333 | 26 | 0.716814 | from .client import Client
__author__ = ".Yo"
__title__ = "discordtxt"
__license__ = "MIT"
__version__ = "1.0.0" | true | true |
f743448f9f13fd7b298c7efb774e8b3569767643 | 146 | py | Python | landingpage/urls.py | mewwts/bandpage | 0c4b054fb5c24f26ff3c5fc73112c6fab975507a | [
"MIT"
] | 4 | 2017-06-05T01:34:32.000Z | 2021-04-10T13:41:22.000Z | landingpage/urls.py | mewwts/bandpage | 0c4b054fb5c24f26ff3c5fc73112c6fab975507a | [
"MIT"
] | 1 | 2016-09-09T12:22:45.000Z | 2016-09-09T12:30:38.000Z | landingpage/urls.py | mewwts/bandpage | 0c4b054fb5c24f26ff3c5fc73112c6fab975507a | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, url
from landingpage import views
urlpatterns = patterns('', url(r'^$', views.index, name='landingpage'))
| 29.2 | 71 | 0.746575 | from django.conf.urls import patterns, url
from landingpage import views
urlpatterns = patterns('', url(r'^$', views.index, name='landingpage'))
| true | true |
f74344ce9edc207f9e76174629f4e13cbba3a4c5 | 336 | py | Python | scripts/internet2.py | jstavr/SDN_Project | 9fe5a65f46eadf15e1da43d9f8125b8c15161bbd | [
"Apache-2.0"
] | null | null | null | scripts/internet2.py | jstavr/SDN_Project | 9fe5a65f46eadf15e1da43d9f8125b8c15161bbd | [
"Apache-2.0"
] | null | null | null | scripts/internet2.py | jstavr/SDN_Project | 9fe5a65f46eadf15e1da43d9f8125b8c15161bbd | [
"Apache-2.0"
] | null | null | null | from os import listdir, system, chdir
PROJECTPATH="../atpg/"
SEARCHPATH="../atpg/work/Internet2/"
chdir(PROJECTPATH)
for f in listdir(SEARCHPATH):
if "combo" in f:
system("./atpg_internet2.py -p 10 -f i2-10.sqlite --folder ~/SDN_Project2/SDN_Project/atpg/work/Internet2/" + f + "/ > ./work/i2-10_" + f + "... | 28 | 155 | 0.645833 | from os import listdir, system, chdir
PROJECTPATH="../atpg/"
SEARCHPATH="../atpg/work/Internet2/"
chdir(PROJECTPATH)
for f in listdir(SEARCHPATH):
if "combo" in f:
system("./atpg_internet2.py -p 10 -f i2-10.sqlite --folder ~/SDN_Project2/SDN_Project/atpg/work/Internet2/" + f + "/ > ./work/i2-10_" + f + "... | true | true |
f74346776705df60807ebb33b50c90ac7d780d0e | 12,331 | py | Python | tests/integration/existing_filesystem_configuration/utils/create_lustre_filesystem.py | beevans/integrated-manager-for-lustre | 6b7e49b8a58058e6139ad815a4388f21a581dfa0 | [
"MIT"
] | 1 | 2021-02-08T16:59:14.000Z | 2021-02-08T16:59:14.000Z | tests/integration/existing_filesystem_configuration/utils/create_lustre_filesystem.py | beevans/integrated-manager-for-lustre | 6b7e49b8a58058e6139ad815a4388f21a581dfa0 | [
"MIT"
] | null | null | null | tests/integration/existing_filesystem_configuration/utils/create_lustre_filesystem.py | beevans/integrated-manager-for-lustre | 6b7e49b8a58058e6139ad815a4388f21a581dfa0 | [
"MIT"
] | null | null | null | import logging
import json
import sys
from testconfig import config
from tests.integration.core.utility_testcase import UtilityTestCase
from tests.integration.utils.test_blockdevices.test_blockdevice import TestBlockDevice
from tests.integration.utils.test_filesystems.test_filesystem import TestFileSystem
logger = lo... | 43.72695 | 139 | 0.635472 | import logging
import json
import sys
from testconfig import config
from tests.integration.core.utility_testcase import UtilityTestCase
from tests.integration.utils.test_blockdevices.test_blockdevice import TestBlockDevice
from tests.integration.utils.test_filesystems.test_filesystem import TestFileSystem
logger = lo... | true | true |
f74346b92f847995f407d9b39abc1b01614058b2 | 382 | py | Python | photo/migrations/0003_remove_comment_post.py | Roseoketch/Insta-Photo | f9416d106b03124b16244cc688a05785a6a0d13c | [
"MIT"
] | 1 | 2021-06-23T12:46:12.000Z | 2021-06-23T12:46:12.000Z | photo/migrations/0003_remove_comment_post.py | Roseoketch/Insta-Photo | f9416d106b03124b16244cc688a05785a6a0d13c | [
"MIT"
] | null | null | null | photo/migrations/0003_remove_comment_post.py | Roseoketch/Insta-Photo | f9416d106b03124b16244cc688a05785a6a0d13c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-05-14 13:02
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('photo', '0002_comment_post'),
]
operations = [
migrations.RemoveField(
mo... | 19.1 | 46 | 0.604712 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('photo', '0002_comment_post'),
]
operations = [
migrations.RemoveField(
model_name='comment',
name='post',
),
]
| true | true |
f74347678cf1255bc6a5f840e5a5a8fe0517ce75 | 655 | py | Python | 2018/Day2/day2_part1.py | dstjacques/AdventOfCode | 75bfb46a01487430d552ea827f0cf8ae3368f686 | [
"MIT"
] | null | null | null | 2018/Day2/day2_part1.py | dstjacques/AdventOfCode | 75bfb46a01487430d552ea827f0cf8ae3368f686 | [
"MIT"
] | null | null | null | 2018/Day2/day2_part1.py | dstjacques/AdventOfCode | 75bfb46a01487430d552ea827f0cf8ae3368f686 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def count_characters(text):
chars = {}
for char in text:
if char not in chars:
chars[char] = 0
chars[char] += 1
counts = [False, False, False, False]
for count in chars.values():
if count < len(counts):
counts[count] = T... | 27.291667 | 84 | 0.671756 |
import sys
def count_characters(text):
chars = {}
for char in text:
if char not in chars:
chars[char] = 0
chars[char] += 1
counts = [False, False, False, False]
for count in chars.values():
if count < len(counts):
counts[count] = True
return counts
... | true | true |
f74348318f65de2c72de05f503bb2e76c858eb4f | 5,971 | py | Python | utils/regression/applications/rtl/RtlInit.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | utils/regression/applications/rtl/RtlInit.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | utils/regression/applications/rtl/RtlInit.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | 34.514451 | 87 | 0.624686 |
from classes.ApplicationOption import (
CommandLineOption,
AppCmdLineOption,
AppPathCmdLineOption,
ApplicationOption,
ParameterProcessor,
)
from common.msg_utils import Msg
from common.path_utils import PathUtils
from common.version_ctrl_utils import VersionCtrlUtils
class RtlCmdL... | true | true |
f74349df1626f3504597ce2a0df9f61d5bd11394 | 800 | py | Python | students/d3310/Li Yunchzhen/Lr2/market/models.py | M1N0K4WA/ITMO_ICT_WebDevelopment_2021-2022_D3310 | aa0e4c10bc88d695e0210e43964dc96096387f8b | [
"MIT"
] | null | null | null | students/d3310/Li Yunchzhen/Lr2/market/models.py | M1N0K4WA/ITMO_ICT_WebDevelopment_2021-2022_D3310 | aa0e4c10bc88d695e0210e43964dc96096387f8b | [
"MIT"
] | null | null | null | students/d3310/Li Yunchzhen/Lr2/market/models.py | M1N0K4WA/ITMO_ICT_WebDevelopment_2021-2022_D3310 | aa0e4c10bc88d695e0210e43964dc96096387f8b | [
"MIT"
] | null | null | null | from operator import mod
from django.db import models
from django.db.models.base import Model
# Create your models here.
class Users(models.Model):
username = models.CharField(max_length=50)
phone = models.CharField(max_length=32,null=True,blank=True)
avatar = models.CharField(max_length=20)
address ... | 36.363636 | 68 | 0.75125 | from operator import mod
from django.db import models
from django.db.models.base import Model
class Users(models.Model):
username = models.CharField(max_length=50)
phone = models.CharField(max_length=32,null=True,blank=True)
avatar = models.CharField(max_length=20)
address = models.CharField(max_len... | true | true |
f74349e091dec79bd6afedf7b876c6610d7395df | 5,806 | py | Python | src/sagemaker_training/entry_point.py | unoebauer/sagemaker-training-toolkit | 0c785b6a0fa4ebc57990417138f537d377366312 | [
"Apache-2.0"
] | 248 | 2020-04-21T09:25:03.000Z | 2022-03-24T22:24:26.000Z | src/sagemaker_training/entry_point.py | unoebauer/sagemaker-training-toolkit | 0c785b6a0fa4ebc57990417138f537d377366312 | [
"Apache-2.0"
] | 68 | 2020-04-22T09:31:18.000Z | 2022-03-19T06:44:36.000Z | src/sagemaker_training/entry_point.py | unoebauer/sagemaker-training-toolkit | 0c785b6a0fa4ebc57990417138f537d377366312 | [
"Apache-2.0"
] | 60 | 2020-06-02T20:52:24.000Z | 2022-03-16T18:20:41.000Z | # Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License'). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' fil... | 40.887324 | 167 | 0.700654 |
from __future__ import absolute_import
import os
import socket
import sys
from retrying import retry
from sagemaker_training import _entry_point_type, environment, files, modules, runner
def run(
uri,
user_entry_point,
args,
env_vars=None,
wait=True,
capture_error=False,
run... | true | true |
f7434aa4138deb086d75218cfeb7dfd6ca67dee1 | 8,153 | py | Python | torchmetrics/classification/f_beta.py | amorehead/metrics | 2e4cb70c46bd775629ceb9d710bc581af8bf92c5 | [
"Apache-2.0"
] | null | null | null | torchmetrics/classification/f_beta.py | amorehead/metrics | 2e4cb70c46bd775629ceb9d710bc581af8bf92c5 | [
"Apache-2.0"
] | null | null | null | torchmetrics/classification/f_beta.py | amorehead/metrics | 2e4cb70c46bd775629ceb9d710bc581af8bf92c5 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 38.82381 | 120 | 0.639765 |
from typing import Any, Optional
import torch
from torch import Tensor
from torchmetrics.functional.classification.f_beta import _fbeta_compute, _fbeta_update
from torchmetrics.metric import Metric
from torchmetrics.utilities import rank_zero_warn
class FBeta(Metric):
def __init__(
self,
... | true | true |
f7434b2e7e663968793574df5334c3c09be59bde | 104,324 | py | Python | packages/python/plotly/plotly/graph_objs/cone/__init__.py | thatneat/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | 1 | 2020-02-29T09:46:51.000Z | 2020-02-29T09:46:51.000Z | packages/python/plotly/plotly/graph_objs/cone/__init__.py | hermitspirit/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/cone/__init__.py | hermitspirit/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
# maxpoints
# ---------
@property
def maxpoints(self):
"""
Sets the maximum number of points to keep on the plots from an
incoming str... | 35.412084 | 90 | 0.567242 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Stream(_BaseTraceHierarchyType):
@property
def maxpoints(self):
return self["maxpoints"]
@maxpoints.setter
def maxpoints(self, val):
self["maxpoints"] = val
... | true | true |
f7434b3811f5e701bd95728b611d15c4aeeb4468 | 1,570 | py | Python | students/K33402/Shuginin_Yurii/LR2/homework_board/board_app/models.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | students/K33402/Shuginin_Yurii/LR2/homework_board/board_app/models.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | students/K33402/Shuginin_Yurii/LR2/homework_board/board_app/models.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | 1 | 2022-03-19T09:24:42.000Z | 2022-03-19T09:24:42.000Z | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
CLASSES_LIST = (
('1-A', '1-A'),
('1-B', '1-B'),
('2-A', '2-A'),
('2-B', '2-B'),
('3-A', '3-A'),
('3-B', '3-B'),
)
class User(AbstractUser):
surname = models.CharField(ma... | 34.130435 | 88 | 0.675159 | from django.db import models
from django.contrib.auth.models import AbstractUser
from django.conf import settings
CLASSES_LIST = (
('1-A', '1-A'),
('1-B', '1-B'),
('2-A', '2-A'),
('2-B', '2-B'),
('3-A', '3-A'),
('3-B', '3-B'),
)
class User(AbstractUser):
surname = models.CharField(ma... | true | true |
f7434b3a115a74c2bb79bc503d9571aa9e68b4ab | 1,404 | py | Python | RQ1_Python/execution_time_per_benchmark.py | stewue/masterthesis-evaluation | 0fb825e196f386c628f95524aa9c80af2126617e | [
"Apache-2.0"
] | null | null | null | RQ1_Python/execution_time_per_benchmark.py | stewue/masterthesis-evaluation | 0fb825e196f386c628f95524aa9c80af2126617e | [
"Apache-2.0"
] | null | null | null | RQ1_Python/execution_time_per_benchmark.py | stewue/masterthesis-evaluation | 0fb825e196f386c628f95524aa9c80af2126617e | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib.ticker import PercentFormatter
data = pd.read_csv('C:\\Users\\stewue\\OneDrive - Wuersten\\Uni\\19_HS\\Masterarbeit\\Repo\\Evaluation\\RQ1_Results\\aggregated\\executiontime.csv')
totalTime = data['executionTime'] * data['parameteri... | 33.428571 | 153 | 0.714387 | import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib.ticker import PercentFormatter
data = pd.read_csv('C:\\Users\\stewue\\OneDrive - Wuersten\\Uni\\19_HS\\Masterarbeit\\Repo\\Evaluation\\RQ1_Results\\aggregated\\executiontime.csv')
totalTime = data['executionTime'] * data['parameteri... | true | true |
f7434b4b046f011b395c11320dcb4ee6a2699b55 | 6,351 | py | Python | bigml/tests/create_lda_steps.py | axellos162/python-4 | 569f6655871ea60b41e9442396433567b9daaea7 | [
"Apache-2.0"
] | 1 | 2019-12-27T12:30:54.000Z | 2019-12-27T12:30:54.000Z | bigml/tests/create_lda_steps.py | axellos162/python-4 | 569f6655871ea60b41e9442396433567b9daaea7 | [
"Apache-2.0"
] | null | null | null | bigml/tests/create_lda_steps.py | axellos162/python-4 | 569f6655871ea60b41e9442396433567b9daaea7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2012-2021 BigML
#
# 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 ... | 38.259036 | 91 | 0.711699 |
import time
import json
import os
from datetime import datetime
from .world import world, res_filename, logged_wait
from nose.tools import eq_, assert_less
from .read_lda_steps import i_get_the_topic_model
from bigml.api import HTTP_CREATED
from bigml.api import HTTP_ACCEPTED
from bigml.api import FIN... | true | true |
f7434cfa92102590dbb78d1a23033888cd01880c | 97,225 | py | Python | ndb/tests/unit/test_model.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | ndb/tests/unit/test_model.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | ndb/tests/unit/test_model.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-15T11:44:36.000Z | 2020-11-15T11:44:36.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.451602 | 79 | 0.625446 |
import datetime
import pickle
import types
import unittest.mock
import zlib
from google.cloud import datastore
from google.cloud.datastore import entity as entity_module
from google.cloud.datastore import helpers
import pytest
from google.cloud.ndb import _datastore_types
from google.cloud.ndb import ex... | true | true |
f7434d1ca7979e8b83ebd1aa83b68c75160c219d | 263 | py | Python | Projects Cousera/Dictionaries/Comparing Lists and Dictinaries.py | teksaulo/My-projects | 3f328c81d12bc77f5374c4a73b92184732d9038c | [
"MIT"
] | null | null | null | Projects Cousera/Dictionaries/Comparing Lists and Dictinaries.py | teksaulo/My-projects | 3f328c81d12bc77f5374c4a73b92184732d9038c | [
"MIT"
] | null | null | null | Projects Cousera/Dictionaries/Comparing Lists and Dictinaries.py | teksaulo/My-projects | 3f328c81d12bc77f5374c4a73b92184732d9038c | [
"MIT"
] | null | null | null | # Dictionaries are like lists except that they use keys
# instead of numbers to look up values
lst = list()
lst.append(21)
lst.append(183)
print(lst)
lst[0] = 23
print(lst)
ddd = dict()
ddd['age'] = 21
ddd['course'] = 182
print(ddd)
ddd['age'] = 23
print(ddd) | 15.470588 | 55 | 0.676806 |
lst = list()
lst.append(21)
lst.append(183)
print(lst)
lst[0] = 23
print(lst)
ddd = dict()
ddd['age'] = 21
ddd['course'] = 182
print(ddd)
ddd['age'] = 23
print(ddd) | true | true |
f7434dacf34167787c3cd3a1d7d74a88a27f16e9 | 433 | py | Python | little_notes/ext/auth/__init__.py | GabrielIFPB/little-notes | cd1176275e9a2523801626a6c22b6218867bd21b | [
"MIT"
] | null | null | null | little_notes/ext/auth/__init__.py | GabrielIFPB/little-notes | cd1176275e9a2523801626a6c22b6218867bd21b | [
"MIT"
] | null | null | null | little_notes/ext/auth/__init__.py | GabrielIFPB/little-notes | cd1176275e9a2523801626a6c22b6218867bd21b | [
"MIT"
] | null | null | null | from flask import Flask
from flask_login import LoginManager
from little_notes.ext.db.models import User
from .main import blueprint
login_manager = LoginManager()
def init_app(app: Flask):
login_manager.init_app(app=app)
login_manager.login_view = "auth.login"
@login_manager.user_loader
def load_... | 21.65 | 47 | 0.759815 | from flask import Flask
from flask_login import LoginManager
from little_notes.ext.db.models import User
from .main import blueprint
login_manager = LoginManager()
def init_app(app: Flask):
login_manager.init_app(app=app)
login_manager.login_view = "auth.login"
@login_manager.user_loader
def load_... | true | true |
f7434db006ae2a0a2eac61e6ebfeed70e731fc39 | 1,136 | py | Python | src/defaults/default_config.py | CoffeeITWorks/csv_normalizer | 88daf94b7af613b3b85dd319100dbef5d8c26c09 | [
"MIT"
] | null | null | null | src/defaults/default_config.py | CoffeeITWorks/csv_normalizer | 88daf94b7af613b3b85dd319100dbef5d8c26c09 | [
"MIT"
] | null | null | null | src/defaults/default_config.py | CoffeeITWorks/csv_normalizer | 88daf94b7af613b3b85dd319100dbef5d8c26c09 | [
"MIT"
] | null | null | null | """
Generates the default configuration for all sections.
"""
import configparser
import socket
def set_defaults():
"""
Generates the default configuration for all sections.
:return: configparser.ConfigParser object
"""
config = configparser.ConfigParser(allow_no_value=True)
common = {
... | 31.555556 | 89 | 0.639965 | import configparser
import socket
def set_defaults():
config = configparser.ConfigParser(allow_no_value=True)
common = {
'csv_import_folder': '',
'csv_export_folder': '',
'csv_export_headers': ('Series_reference', 'Period', 'ELEE'),
'csv_delimiter': ';',
... | true | true |
f7434ebe3af0fd7c0d2692ad49deae46bb4b1d01 | 4,760 | py | Python | mcrt/geometry.py | alexander-lazarov/mc-ray-tracer | 3027840463ea291b6bf16ed227060ef4de2f4f54 | [
"MIT"
] | null | null | null | mcrt/geometry.py | alexander-lazarov/mc-ray-tracer | 3027840463ea291b6bf16ed227060ef4de2f4f54 | [
"MIT"
] | null | null | null | mcrt/geometry.py | alexander-lazarov/mc-ray-tracer | 3027840463ea291b6bf16ed227060ef4de2f4f54 | [
"MIT"
] | null | null | null | from math import sqrt
EPSILON = 1e-7
def dot3(a, b):
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
def cross3(a, b):
return (a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] * b[0])
def subtract3(a, b):
return (a[0] - b[0],
a[1] - b[1],
... | 24.791667 | 75 | 0.513866 | from math import sqrt
EPSILON = 1e-7
def dot3(a, b):
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
def cross3(a, b):
return (a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] * b[0])
def subtract3(a, b):
return (a[0] - b[0],
a[1] - b[1],
... | true | true |
f7434fadb6405a035afad6ef15c5b608f587ba64 | 24 | py | Python | celery-worker/main.py | sinedie/Flask-Svelte-Websockets-Nginx-Docker | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | 4 | 2021-11-21T14:04:15.000Z | 2022-03-20T15:28:14.000Z | celery-worker/main.py | sinedie/Utimate-flask-websocket-template | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | null | null | null | celery-worker/main.py | sinedie/Utimate-flask-websocket-template | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | null | null | null | from celery_app import * | 24 | 24 | 0.833333 | from celery_app import * | true | true |
f743514d76fc895d351ddfbe48fe03a94f6bc43a | 8,884 | py | Python | ctrack/register/forms.py | yulqen/ctrack | b370cdda72e7fab9b85a4e737923fabef679e31d | [
"MIT"
] | null | null | null | ctrack/register/forms.py | yulqen/ctrack | b370cdda72e7fab9b85a4e737923fabef679e31d | [
"MIT"
] | 16 | 2020-08-13T09:18:57.000Z | 2021-11-05T14:32:05.000Z | ctrack/register/forms.py | hammerheadlemon/ctrack | b370cdda72e7fab9b85a4e737923fabef679e31d | [
"MIT"
] | null | null | null | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Button, ButtonHolder, Field, Hidden, Layout, Submit
from django import forms
from django.core.exceptions import ValidationError
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.safestring import ma... | 33.908397 | 98 | 0.544575 | from crispy_forms.helper import FormHelper
from crispy_forms.layout import Button, ButtonHolder, Field, Hidden, Layout, Submit
from django import forms
from django.core.exceptions import ValidationError
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.safestring import ma... | true | true |
f74353ae494cdbffdce4181d3a27780061de5243 | 87,815 | py | Python | neutron/tests/unit/objects/test_base.py | flavio-fernandes/neutron | 4a021306ad53c588dd9f8269124e7b0d49a2c752 | [
"Apache-2.0"
] | 4 | 2015-11-07T01:58:32.000Z | 2019-10-08T06:18:36.000Z | neutron/tests/unit/objects/test_base.py | flavio-fernandes/neutron | 4a021306ad53c588dd9f8269124e7b0d49a2c752 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/objects/test_base.py | flavio-fernandes/neutron | 4a021306ad53c588dd9f8269124e7b0d49a2c752 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 39.185631 | 79 | 0.636156 |
import collections
import copy
import itertools
import random
from unittest import mock
import fixtures
import netaddr
from neutron_lib import constants
from neutron_lib import context
from neutron_lib.db import api as db_api
from neutron_lib.db import model_query
from neutron_lib import exceptions as n_ex... | true | true |
f74353fc4fa2f503ed77dcf9b86f6f6b55d18be5 | 6,633 | py | Python | extension_templates/clustering.py | Aparna-Sakshi/sktime | 419d347f062320290fb65e4afec72b82179e63bf | [
"BSD-3-Clause"
] | null | null | null | extension_templates/clustering.py | Aparna-Sakshi/sktime | 419d347f062320290fb65e4afec72b82179e63bf | [
"BSD-3-Clause"
] | null | null | null | extension_templates/clustering.py | Aparna-Sakshi/sktime | 419d347f062320290fb65e4afec72b82179e63bf | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Extension template for clusterers.
Purpose of this implementation template:
quick implementation of new estimators following the template
NOT a concrete class to import! This is NOT a base class or concrete class!
This is to be used as a "fill-in" coding template.
How to use th... | 37.055866 | 88 | 0.656716 |
import numpy as np
from sktime.clustering.base import BaseClusterer
class MyClusterer(BaseClusterer):
_tags = {
"X_inner_mtype": "numpy3D",
"capability:multivariate": False,
"capability:unequal_length": False,
"capability:missing_values": False,
... | true | true |
f74355617e366f52ecbec3cbfab494ba12ca2fee | 3,554 | py | Python | backend/person_app/events/birth/models.py | berserg2010/family_and_history_backend | 08fd5901e6e0c9cbd75a72e46d69ac53c737786a | [
"Apache-2.0"
] | null | null | null | backend/person_app/events/birth/models.py | berserg2010/family_and_history_backend | 08fd5901e6e0c9cbd75a72e46d69ac53c737786a | [
"Apache-2.0"
] | null | null | null | backend/person_app/events/birth/models.py | berserg2010/family_and_history_backend | 08fd5901e6e0c9cbd75a72e46d69ac53c737786a | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.db.models import Q
from core.models import (
choices,
DateTime,
EventField,
GivName,
SurName,
link_inc,
link_dec,
)
from person_app.person.models import Person
class Birth(EventField):
_person = models.ForeignKey(
Person,
on_del... | 25.941606 | 80 | 0.521384 | from django.db import models
from django.db.models import Q
from core.models import (
choices,
DateTime,
EventField,
GivName,
SurName,
link_inc,
link_dec,
)
from person_app.person.models import Person
class Birth(EventField):
_person = models.ForeignKey(
Person,
on_del... | true | true |
f743559254ce187e8951e816d36bdbeaaf0f6a9c | 41,680 | py | Python | squad_trans.py | VITA-Group/BERT-Tickets | 4d8e0356939e7045e2f5ee908412a5026051d162 | [
"MIT"
] | 95 | 2020-08-20T23:24:50.000Z | 2022-03-03T16:56:51.000Z | squad_trans.py | TAMU-VITA/BERT-Tickets | 4d8e0356939e7045e2f5ee908412a5026051d162 | [
"MIT"
] | 6 | 2020-10-07T16:35:29.000Z | 2022-03-10T03:30:15.000Z | squad_trans.py | harrywuhust2022/BERT-Tickets | 4d8e0356939e7045e2f5ee908412a5026051d162 | [
"MIT"
] | 12 | 2020-08-20T23:25:06.000Z | 2022-01-14T12:06:30.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... | 41.267327 | 126 | 0.648968 |
import argparse
import glob
import logging
import os
import random
import timeit
import torch.nn.utils.prune as prune
import numpy as np
import torch
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler
from torch.utils.data.distributed import DistributedSampler
from tqdm import tq... | true | true |
f74356b9dd5538ff2ebb6a9ba0a601fa1d81caad | 1,593 | py | Python | eval_LFW.py | bubbliiiing/arcface-keras | 2c88baeba229ffdc1f75049113814a0eb9b71906 | [
"MIT"
] | 2 | 2022-03-08T03:49:10.000Z | 2022-03-20T08:14:04.000Z | eval_LFW.py | bubbliiiing/arcface-keras | 2c88baeba229ffdc1f75049113814a0eb9b71906 | [
"MIT"
] | null | null | null | eval_LFW.py | bubbliiiing/arcface-keras | 2c88baeba229ffdc1f75049113814a0eb9b71906 | [
"MIT"
] | null | null | null | from nets.arcface import arcface
from utils.dataloader import LFWDataset
from utils.utils_metrics import test
if __name__ == "__main__":
#--------------------------------------#
# 主干特征提取网络的选择
# mobilefacenet
# mobilenetv1
# mobilenetv2
# mobilenetv3
# iresnet50
#... | 35.4 | 125 | 0.425612 | from nets.arcface import arcface
from utils.dataloader import LFWDataset
from utils.utils_metrics import test
if __name__ == "__main__":
backbone = "mobilefacenet"
input_shape = [112, 112, 3]
model_path = "model_data/arcface_m... | true | true |
f743571533a8f1ae366a0dbac4b2cb0b6ef24fa0 | 49 | py | Python | chat_service/chat_api_service/chat_api_middleware/chat_core/chat_domain.py | YoungchanChang/ES_BERT_CHAT | 5dd919d3ba559ca9171ca73bd9e1052734f3060e | [
"Apache-2.0"
] | 1 | 2022-02-13T03:09:23.000Z | 2022-02-13T03:09:23.000Z | chat_service/chat_middleware/chat_core/chat_domain.py | YoungchanChang/ES_BERT_CHAT | 5dd919d3ba559ca9171ca73bd9e1052734f3060e | [
"Apache-2.0"
] | null | null | null | chat_service/chat_middleware/chat_core/chat_domain.py | YoungchanChang/ES_BERT_CHAT | 5dd919d3ba559ca9171ca73bd9e1052734f3060e | [
"Apache-2.0"
] | 1 | 2022-02-13T03:09:23.000Z | 2022-02-13T03:09:23.000Z | from chat_service.chat_core.chat_domain import *
| 24.5 | 48 | 0.857143 | from chat_service.chat_core.chat_domain import *
| true | true |
f7435762fbddc1ecdbf1899aa83502bddfc7df0f | 4,186 | py | Python | vision-widgets/src/bsmu/vision/widgets/visibility.py | IvanKosik/vision | 74603d4b727e6d993b562eb4656952e29173323e | [
"BSD-3-Clause"
] | 2 | 2019-10-15T11:34:17.000Z | 2021-02-03T10:46:07.000Z | vision-widgets/src/bsmu/vision/widgets/visibility.py | IvanKosik/vision | 74603d4b727e6d993b562eb4656952e29173323e | [
"BSD-3-Clause"
] | null | null | null | vision-widgets/src/bsmu/vision/widgets/visibility.py | IvanKosik/vision | 74603d4b727e6d993b562eb4656952e29173323e | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from PySide2.QtCore import QSize, Signal
from PySide2.QtGui import QIcon, QColor
from PySide2.QtWidgets import QWidget, QPushButton, QHBoxLayout, QSizePolicy, QFrame
from bsmu.vision.widgets.combo_slider import ComboSlider
from bsmu.vision.widgets.images import icons_rc # noqa
DEF... | 33.222222 | 116 | 0.682035 | from __future__ import annotations
from PySide2.QtCore import QSize, Signal
from PySide2.QtGui import QIcon, QColor
from PySide2.QtWidgets import QWidget, QPushButton, QHBoxLayout, QSizePolicy, QFrame
from bsmu.vision.widgets.combo_slider import ComboSlider
from bsmu.vision.widgets.images import icons_rc
DEFAULT_C... | true | true |
f7435892db5bf75313cbc3b0fcce7a046add287c | 199 | py | Python | Curso em Video/Desafio_028.py | tonmarcondes/UNIVESP | a66a623d4811e8f3f9e2999f09e38a4470035ae2 | [
"MIT"
] | null | null | null | Curso em Video/Desafio_028.py | tonmarcondes/UNIVESP | a66a623d4811e8f3f9e2999f09e38a4470035ae2 | [
"MIT"
] | null | null | null | Curso em Video/Desafio_028.py | tonmarcondes/UNIVESP | a66a623d4811e8f3f9e2999f09e38a4470035ae2 | [
"MIT"
] | null | null | null | from random import randint
nome = int(input('\nInsira um número de 1 a 5: '))
randomico = randint(1, 5)
if randomico == nome:
print('Você VENCEU\n')
else:
print('Você PERDEU\n')
| 18.090909 | 51 | 0.623116 | from random import randint
nome = int(input('\nInsira um número de 1 a 5: '))
randomico = randint(1, 5)
if randomico == nome:
print('Você VENCEU\n')
else:
print('Você PERDEU\n')
| true | true |
f74359bc0fe7e7599cf0b67743e14d7fc52cd10a | 4,395 | py | Python | getdata/select_sf.py | tedunderwood/measureperspective | 46ba16e6ef3d4e17626a6366bcb98ec554f7bc83 | [
"MIT"
] | 4 | 2017-12-18T18:58:11.000Z | 2020-07-05T16:14:11.000Z | getdata/select_sf.py | tedunderwood/measureperspective | 46ba16e6ef3d4e17626a6366bcb98ec554f7bc83 | [
"MIT"
] | null | null | null | getdata/select_sf.py | tedunderwood/measureperspective | 46ba16e6ef3d4e17626a6366bcb98ec554f7bc83 | [
"MIT"
] | 2 | 2018-06-21T22:31:31.000Z | 2019-07-31T15:49:35.000Z | # intersection_of_sf.py
# This script uses Library of Congress tags,
# plus a list of volumes called "science fiction"
# by the OCLC, to extract Hathi vols likely to
# be SF. Some further manual grooming
# will be required.
import csv
from difflib import SequenceMatcher
import SonicScrewdriver as utils
def titleregu... | 28.72549 | 169 | 0.574061 |
import csv
from difflib import SequenceMatcher
import SonicScrewdriver as utils
def titleregularize(title):
title = title.lower().strip('/ .,:-')
title = title.replace('the', 'x')
if len(title) < 4:
title = title + " "
firstchars = title[0:3]
return title, firstchars
def autho... | true | true |
f7435a50febeab4f0b145be21f6feb036e9d926b | 295 | py | Python | Python/06. Itertools/007. Maximize It!.py | AnTeater515/HackerRank-Coding_Solutions | c5c1337ed6d70c6d7a1850b2a99aab10c285c290 | [
"MIT"
] | 1 | 2020-10-18T22:06:12.000Z | 2020-10-18T22:06:12.000Z | Python/06. Itertools/007. Maximize It!.py | AnTeater515/HackerRank-Coding-Solutions_Python3_C-_Oracle-SQL | c5c1337ed6d70c6d7a1850b2a99aab10c285c290 | [
"MIT"
] | null | null | null | Python/06. Itertools/007. Maximize It!.py | AnTeater515/HackerRank-Coding-Solutions_Python3_C-_Oracle-SQL | c5c1337ed6d70c6d7a1850b2a99aab10c285c290 | [
"MIT"
] | null | null | null | # Problem: https://www.hackerrank.com/challenges/maximize-it/problem
# Score: 50
from itertools import product
k, m = map(int, input().split())
n = (list(map(int, input().split()))[1:] for _ in range(k))
results = (sum(i**2 for i in x) % m for x in product(*n))
print(max(results))
| 26.818182 | 69 | 0.640678 |
from itertools import product
k, m = map(int, input().split())
n = (list(map(int, input().split()))[1:] for _ in range(k))
results = (sum(i**2 for i in x) % m for x in product(*n))
print(max(results))
| true | true |
f7435aea1f8fba2fa94b04750cf47858a5a42b17 | 602,219 | py | Python | lldb/bindings/python/static-binding/lldb.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | 2 | 2021-11-20T04:04:47.000Z | 2022-01-06T07:44:23.000Z | lldb/bindings/python/static-binding/lldb.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | lldb/bindings/python/static-binding/lldb.py | LaudateCorpus1/llvm-project-staging | cc926dc3a87af7023aa9b6c392347a0a8ed6949b | [
"Apache-2.0"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
The lldb module contains the public APIs for Python binding.
Some of the important classes are described here:
... | 40.71248 | 509 | 0.693417 |
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise RuntimeError("Python 2.7 or later required")
try:
# _lldb should be a built-in module.
import _lldb
except ImportError:
# Relative import should work if we are being loaded by Python.
... | true | true |
f7435b6df5e8379dcdef0246f8e30430db6a2fe6 | 16,824 | py | Python | protos/gen/python/protos/public/modeldb/metadata/MetadataService_pb2.py | Atharex/modeldb | 3a286d5861c1dd14342084793dd7d7584ff8a29b | [
"Apache-2.0"
] | null | null | null | protos/gen/python/protos/public/modeldb/metadata/MetadataService_pb2.py | Atharex/modeldb | 3a286d5861c1dd14342084793dd7d7584ff8a29b | [
"Apache-2.0"
] | null | null | null | protos/gen/python/protos/public/modeldb/metadata/MetadataService_pb2.py | Atharex/modeldb | 3a286d5861c1dd14342084793dd7d7584ff8a29b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: modeldb/metadata/MetadataService.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 sym... | 37.469933 | 1,810 | 0.764979 |
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()
from google.api import annotations_pb2 as google_dot_ap... | true | true |
f7435b853c2d3e694d097f762e4c49dceddc21dc | 198 | py | Python | tuple_lenminmax.py | ISE2012/ch11 | b05ea7d431a57e2ae79e6f488e941436e1689d9c | [
"MIT"
] | null | null | null | tuple_lenminmax.py | ISE2012/ch11 | b05ea7d431a57e2ae79e6f488e941436e1689d9c | [
"MIT"
] | null | null | null | tuple_lenminmax.py | ISE2012/ch11 | b05ea7d431a57e2ae79e6f488e941436e1689d9c | [
"MIT"
] | null | null | null | mytuple = (9,8,7,5,4,1,2,3)
num = len(mytuple)
print("# of element:", num)
min_value = min(mytuple)
max_value = max(mytuple)
print("Min value:", min_value)
print("Max value:", max_value)
| 19.8 | 31 | 0.641414 | mytuple = (9,8,7,5,4,1,2,3)
num = len(mytuple)
print("# of element:", num)
min_value = min(mytuple)
max_value = max(mytuple)
print("Min value:", min_value)
print("Max value:", max_value)
| true | true |
f7435cd562697e1cc976e916003e38001a1a1351 | 16,047 | py | Python | seqio/loggers.py | ayushkumar63123/seqio | 23bcb59df59798074d7d5896a131980137c69ec8 | [
"Apache-2.0"
] | 144 | 2021-04-16T00:43:10.000Z | 2022-03-21T08:51:27.000Z | seqio/loggers.py | ayushkumar63123/seqio | 23bcb59df59798074d7d5896a131980137c69ec8 | [
"Apache-2.0"
] | 49 | 2021-04-26T06:28:51.000Z | 2022-03-28T23:55:16.000Z | seqio/loggers.py | ayushkumar63123/seqio | 23bcb59df59798074d7d5896a131980137c69ec8 | [
"Apache-2.0"
] | 13 | 2021-04-27T10:28:27.000Z | 2022-03-10T18:43:37.000Z | # Copyright 2021 The SeqIO Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 38.026066 | 80 | 0.647785 |
import abc
import base64
import itertools
import json
import os
import time
from typing import Any, Mapping, Optional, Sequence, Type
from absl import logging
import numpy as np
from seqio import metrics as metrics_lib
import tensorflow as tf
import tensorflow_datasets as tfds
class Logger(abc.ABC):
... | true | true |
f7435d3608fe18ecd0d835748ff802f63381f469 | 3,289 | py | Python | config/settings.py | JoaoGuilhermeBNascimento/DjangoAPI | 196ecbe96d9483f93087550f68ada346dc13e37c | [
"MIT"
] | null | null | null | config/settings.py | JoaoGuilhermeBNascimento/DjangoAPI | 196ecbe96d9483f93087550f68ada346dc13e37c | [
"MIT"
] | null | null | null | config/settings.py | JoaoGuilhermeBNascimento/DjangoAPI | 196ecbe96d9483f93087550f68ada346dc13e37c | [
"MIT"
] | null | null | null | """
Django settings for config project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib ... | 25.695313 | 91 | 0.700517 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-id2#q4k$-z*z2-uu#+i$gfmz6u6hwytmh@o7vx=qi=(p3*6lms'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contr... | true | true |
f7435d7f54be6c716a5f018ec0bd11c9d123ac0a | 37,429 | py | Python | substance_assets_image_downloader.py | Burve/Adobe-Substance-3D-Assets-Images | 74fdc1b956d5423c3408472cc90545d9b861788d | [
"MIT"
] | null | null | null | substance_assets_image_downloader.py | Burve/Adobe-Substance-3D-Assets-Images | 74fdc1b956d5423c3408472cc90545d9b861788d | [
"MIT"
] | null | null | null | substance_assets_image_downloader.py | Burve/Adobe-Substance-3D-Assets-Images | 74fdc1b956d5423c3408472cc90545d9b861788d | [
"MIT"
] | null | null | null | """
Downloading images scrapped from the https://substance3d.adobe.com/assets/allassets
and saved in local SQLite file
"""
import os
import time
import sys
import platform
from os import path
import requests # to get image from the web
import shutil # to save it locally
from rich import pretty
from rich.console i... | 41.820112 | 123 | 0.441743 | import os
import time
import sys
import platform
from os import path
import requests
import shutil
from rich import pretty
from rich.console import Console
from rich.traceback import install
from rich.progress import track
from common_database_access import CommonDatabaseAccess
import f_icon
from pathlib imp... | true | true |
f7435decafc5257d36b28eec6bd5d5cc601493cf | 11,070 | py | Python | utils/process-stats-dir.py | grabnanda/swift | dd1d8891bd215d4482cd5c67a29aa1ab6d54f6f2 | [
"Apache-2.0"
] | null | null | null | utils/process-stats-dir.py | grabnanda/swift | dd1d8891bd215d4482cd5c67a29aa1ab6d54f6f2 | [
"Apache-2.0"
] | null | null | null | utils/process-stats-dir.py | grabnanda/swift | dd1d8891bd215d4482cd5c67a29aa1ab6d54f6f2 | [
"Apache-2.0"
] | 1 | 2022-03-17T16:58:34.000Z | 2022-03-17T16:58:34.000Z | #!/usr/bin/python
#
# ==-- process-stats-dir - summarize one or more Swift -stats-output-dirs --==#
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014-2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://s... | 37.525424 | 79 | 0.566576 |
import argparse
import csv
import json
import os
import random
import re
import sys
class JobStats:
def __init__(self, jobkind, jobid, module, start_usec, dur_usec,
jobargs, stats):
self.jobkind = jobkind
self.jobid = jobid
self.module = module
self... | true | true |
f7435e0370c2f5428279ac514e1d9fc7fd041067 | 326 | py | Python | manager_utils/__init__.py | alextatarinov/django-manager-utils | 08fbd1b2a5a19842fa499d5be8b742e70d3eba2b | [
"MIT"
] | 50 | 2015-02-03T22:11:03.000Z | 2021-09-14T21:22:52.000Z | manager_utils/__init__.py | alextatarinov/django-manager-utils | 08fbd1b2a5a19842fa499d5be8b742e70d3eba2b | [
"MIT"
] | 19 | 2015-01-26T22:28:06.000Z | 2020-12-29T09:35:11.000Z | manager_utils/__init__.py | alextatarinov/django-manager-utils | 08fbd1b2a5a19842fa499d5be8b742e70d3eba2b | [
"MIT"
] | 13 | 2015-02-14T03:40:21.000Z | 2022-01-17T11:57:15.000Z | # flake8: noqa
from .version import __version__
from .manager_utils import (
ManagerUtilsMixin, ManagerUtilsManager, ManagerUtilsQuerySet, post_bulk_operation,
upsert, bulk_update, single, get_or_none, bulk_upsert, bulk_upsert2, id_dict, sync,
sync2
)
default_app_config = 'manager_utils.apps.ManagerUtilsCo... | 32.6 | 87 | 0.803681 |
from .version import __version__
from .manager_utils import (
ManagerUtilsMixin, ManagerUtilsManager, ManagerUtilsQuerySet, post_bulk_operation,
upsert, bulk_update, single, get_or_none, bulk_upsert, bulk_upsert2, id_dict, sync,
sync2
)
default_app_config = 'manager_utils.apps.ManagerUtilsConfig'
| true | true |
f74362393f92a1103ef013efd35f397fe314effc | 1,070 | py | Python | kubernetes/test/test_v1beta1_self_subject_rules_review.py | iamneha/python | 5b208a1a49a8d6f8bbab28bcc226b9ef793bcbd0 | [
"Apache-2.0"
] | 1 | 2019-02-17T15:28:39.000Z | 2019-02-17T15:28:39.000Z | kubernetes/test/test_v1beta1_self_subject_rules_review.py | iamneha/python | 5b208a1a49a8d6f8bbab28bcc226b9ef793bcbd0 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_self_subject_rules_review.py | iamneha/python | 5b208a1a49a8d6f8bbab28bcc226b9ef793bcbd0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 23.777778 | 107 | 0.738318 |
from __future__ import absolute_import
import os
import sys
import unittest
import kubernetes.client
from kubernetes.client.rest import ApiException
from kubernetes.client.models.v1beta1_self_subject_rules_review import V1beta1SelfSubjectRulesReview
class TestV1beta1SelfSubjectRulesReview(unittest.TestCase):
... | true | true |
f74362d4e8237ba8aa2522d4438f89a5b5dea448 | 23,002 | py | Python | tensorflow/contrib/data/python/kernel_tests/dataset_constructor_op_test.py | TTrapper/tensorflow | 64f0ebd33a7c868da3c8f1ea15adf358c578f227 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/data/python/kernel_tests/dataset_constructor_op_test.py | TTrapper/tensorflow | 64f0ebd33a7c868da3c8f1ea15adf358c578f227 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/data/python/kernel_tests/dataset_constructor_op_test.py | TTrapper/tensorflow | 64f0ebd33a7c868da3c8f1ea15adf358c578f227 | [
"Apache-2.0"
] | 1 | 2019-01-08T07:16:49.000Z | 2019-01-08T07:16:49.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 applica... | 41.594937 | 80 | 0.662334 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
import numpy as np
from tensorflow.contrib.data.python.ops import batching
from tensorflow.contrib.data.python.ops import dataset_ops
from tensorflow.core.protobuf import config... | true | true |
f74362f7f8beb3b636ddf19bdaf15ef733bde103 | 93 | py | Python | Magics/__init__.py | yetzu/magics-python | 6562398beac6e9dea14525f0a13cd648130013fa | [
"Apache-2.0"
] | 1 | 2021-12-23T12:52:24.000Z | 2021-12-23T12:52:24.000Z | Magics/__init__.py | yetzu/magics-python | 6562398beac6e9dea14525f0a13cd648130013fa | [
"Apache-2.0"
] | null | null | null | Magics/__init__.py | yetzu/magics-python | 6562398beac6e9dea14525f0a13cd648130013fa | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from .Magics import * # noqa
__version__ = "1.5.7"
| 15.5 | 38 | 0.741935 | from __future__ import absolute_import
from .Magics import *
__version__ = "1.5.7"
| true | true |
f7436313e3d13d74205ea5b07382592a3864d1c2 | 4,896 | py | Python | benchmark/toyctf_benchmark_KG_test_P.py | syheliel/CyberBattleSim-1 | 611f0dde9fbfabc411b40a92446c71ff7052480a | [
"MIT"
] | null | null | null | benchmark/toyctf_benchmark_KG_test_P.py | syheliel/CyberBattleSim-1 | 611f0dde9fbfabc411b40a92446c71ff7052480a | [
"MIT"
] | null | null | null | benchmark/toyctf_benchmark_KG_test_P.py | syheliel/CyberBattleSim-1 | 611f0dde9fbfabc411b40a92446c71ff7052480a | [
"MIT"
] | null | null | null | # %%
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""Benchmark all the baseline agents
on a given CyberBattleSim environment and compare
them to the dumb 'random agent' baseline.
NOTE: You can run this `.py`-notebook directly from VSCode.
You can also generate a traditional Jupyter Noteboo... | 31.792208 | 96 | 0.651348 |
from functools import partial
from cyberbattle._env import CyberBattleEnv
import sys
import logging
import gym
import cyberbattle.agents.baseline.learner as learner
import cyberbattle.agents.baseline.plotting as plotting
import cyberbattle.agents.baseline.agent_wrapper as w
import cyberbattle.agents.baseline.ag... | true | true |
f74363874ba348431a6dff3cd034a7ed65b0be5f | 1,272 | py | Python | app/tests/integration/ExerciseEvaluationMongoQueryRepositoryIntegrationTest.py | GPortas/Playgroundb | 60f98a4dd62ce34fbb8abfa0d9ee63697e82c57e | [
"Apache-2.0"
] | 1 | 2019-01-30T19:59:20.000Z | 2019-01-30T19:59:20.000Z | app/tests/integration/ExerciseEvaluationMongoQueryRepositoryIntegrationTest.py | GPortas/Playgroundb | 60f98a4dd62ce34fbb8abfa0d9ee63697e82c57e | [
"Apache-2.0"
] | null | null | null | app/tests/integration/ExerciseEvaluationMongoQueryRepositoryIntegrationTest.py | GPortas/Playgroundb | 60f98a4dd62ce34fbb8abfa0d9ee63697e82c57e | [
"Apache-2.0"
] | null | null | null | from app.api.data.query.ExerciseEvaluationMongoQueryRepository import ExerciseEvaluationMongoQueryRepository
from tests.integration.PdbMongoIntegrationTestBase import PdbMongoIntegrationTestBase
class ExerciseEvaluationMongoQueryRepositoryIntegrationTest(PdbMongoIntegrationTestBase):
def setUp(self):
sel... | 53 | 108 | 0.742138 | from app.api.data.query.ExerciseEvaluationMongoQueryRepository import ExerciseEvaluationMongoQueryRepository
from tests.integration.PdbMongoIntegrationTestBase import PdbMongoIntegrationTestBase
class ExerciseEvaluationMongoQueryRepositoryIntegrationTest(PdbMongoIntegrationTestBase):
def setUp(self):
sel... | true | true |
f74364bc8bc38dd5a0a1cf3481116cccaa4295fd | 3,564 | py | Python | homeassistant/components/neato/config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 2 | 2021-05-19T19:05:08.000Z | 2021-06-06T06:51:05.000Z | homeassistant/components/neato/config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 56 | 2020-08-03T07:30:54.000Z | 2022-03-31T06:02:04.000Z | homeassistant/components/neato/config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 2 | 2020-12-25T16:31:22.000Z | 2020-12-30T20:53:56.000Z | """Config flow to configure Neato integration."""
import logging
from pybotvac import Account, Neato, Vorwerk
from pybotvac.exceptions import NeatoLoginException, NeatoRobotException
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
# pyli... | 31.539823 | 86 | 0.609147 |
import logging
from pybotvac import Account, Neato, Vorwerk
from pybotvac.exceptions import NeatoLoginException, NeatoRobotException
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from .const import CONF_VENDOR, NEATO_DOMAIN, VALID_VEN... | true | true |
f74365a429bd712a7f853bd9f9ac47da5f10a9a0 | 421 | py | Python | lists/migrations/0003_auto_20180225_1551.py | christiankuhl/todolist | a10316f8b24c33da7d0b386a4fda5b4a9c128cae | [
"MIT"
] | null | null | null | lists/migrations/0003_auto_20180225_1551.py | christiankuhl/todolist | a10316f8b24c33da7d0b386a4fda5b4a9c128cae | [
"MIT"
] | 5 | 2020-06-05T17:35:16.000Z | 2021-09-07T10:20:36.000Z | lists/migrations/0003_auto_20180225_1551.py | christiankuhl/todolist | a10316f8b24c33da7d0b386a4fda5b4a9c128cae | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-02-25 14:51
from django.db import migrations
import lists.models
class Migration(migrations.Migration):
dependencies = [
('lists', '0002_auto_20180225_1540'),
]
operations = [
migrations.AlterField(
model_name='todo',
... | 21.05 | 57 | 0.581948 |
from django.db import migrations
import lists.models
class Migration(migrations.Migration):
dependencies = [
('lists', '0002_auto_20180225_1540'),
]
operations = [
migrations.AlterField(
model_name='todo',
name='due_date',
field=lists.... | true | true |
f74365b334d17e326df7ce78f0ed38b4897d908b | 979 | py | Python | craigslist/komand_craigslist/util/util.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2020-03-18T09:14:55.000Z | 2020-03-18T09:14:55.000Z | craigslist/komand_craigslist/util/util.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2021-02-23T23:57:37.000Z | 2021-02-23T23:57:37.000Z | craigslist/komand_craigslist/util/util.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | for_sale_category = {
"antiques": "ata",
"appliances": "ppa",
"arts+crafts": "ara",
"atv/utv/sno": "sna",
"auto parts": "pta wta",
"baby+kids": "baa",
"barter": "bar",
"beauty+hlth": "haa",
"bikes": "bia bip",
"boats": "boo bpa",
"books": "bka",
"business": "bfa",
"ca... | 23.309524 | 29 | 0.490296 | for_sale_category = {
"antiques": "ata",
"appliances": "ppa",
"arts+crafts": "ara",
"atv/utv/sno": "sna",
"auto parts": "pta wta",
"baby+kids": "baa",
"barter": "bar",
"beauty+hlth": "haa",
"bikes": "bia bip",
"boats": "boo bpa",
"books": "bka",
"business": "bfa",
"ca... | true | true |
f743672619f9294cdd190a17da3f8a65fdbe40c2 | 10,695 | py | Python | exec/src/klio_exec/commands/profile.py | gaybro8777/klio | e14055fba73f275ebbe7b3b64cc43beaa4ac2f69 | [
"Apache-2.0"
] | 705 | 2020-10-02T17:25:31.000Z | 2022-03-24T15:26:53.000Z | exec/src/klio_exec/commands/profile.py | gaybro8777/klio | e14055fba73f275ebbe7b3b64cc43beaa4ac2f69 | [
"Apache-2.0"
] | 63 | 2020-10-02T17:53:47.000Z | 2022-03-23T21:36:40.000Z | exec/src/klio_exec/commands/profile.py | gaybro8777/klio | e14055fba73f275ebbe7b3b64cc43beaa4ac2f69 | [
"Apache-2.0"
] | 49 | 2020-10-13T18:44:34.000Z | 2022-03-18T08:38:15.000Z | # Copyright 2020 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 34.837134 | 78 | 0.643104 |
import collections
import contextlib
import functools
import logging
import os
import subprocess
import sys
import tempfile
import time
import apache_beam as beam
try:
import memory_profiler
except ImportError:
logging.error(
"Failed to import profiling dependencies. Did you install "... | true | true |
f7436741620246ac9158abc69e332713dde4d817 | 25,823 | py | Python | assignment 3/pg.py | YWJae/CS234-Reinforcement-Learning-Winter-2019 | 6e76a8cba75d68e94c9b05a23b603c399f30fc8c | [
"MIT"
] | 133 | 2019-07-28T06:16:05.000Z | 2022-03-23T07:49:29.000Z | assignment 3/pg.py | Huixxi/CS234-Reinforcement-Learning | aa95a42b847a0e752b8caaa7b0bfeffb514ab7d3 | [
"MIT"
] | 13 | 2019-12-16T22:03:08.000Z | 2022-02-09T23:30:14.000Z | assignment 3/pg.py | Huixxi/CS234-Reinforcement-Learning | aa95a42b847a0e752b8caaa7b0bfeffb514ab7d3 | [
"MIT"
] | 46 | 2019-07-28T13:41:10.000Z | 2022-03-24T13:40:16.000Z | # -*- coding: UTF-8 -*-
import os
import argparse
import sys
import logging
import time
import numpy as np
import tensorflow as tf
import gym
import scipy.signal
import os
import time
import inspect
from utils.general import get_logger, Progbar, export_plot
from config import get_config
parser = argparse.ArgumentPars... | 41.383013 | 128 | 0.567943 |
import os
import argparse
import sys
import logging
import time
import numpy as np
import tensorflow as tf
import gym
import scipy.signal
import os
import time
import inspect
from utils.general import get_logger, Progbar, export_plot
from config import get_config
parser = argparse.ArgumentParser()
parser.add_argumen... | true | true |
f743687cc0b250ce1a612074e35283ba6bcc84db | 8,280 | py | Python | kowalski/dev/ingest_known_lenses_20180901.py | dmitryduev/broker | 7b9582fae6cd37bbd334bca228ef429d96e0e498 | [
"MIT"
] | 1 | 2021-12-15T09:46:00.000Z | 2021-12-15T09:46:00.000Z | kowalski/dev/ingest_known_lenses_20180901.py | dmitryduev/broker | 7b9582fae6cd37bbd334bca228ef429d96e0e498 | [
"MIT"
] | null | null | null | kowalski/dev/ingest_known_lenses_20180901.py | dmitryduev/broker | 7b9582fae6cd37bbd334bca228ef429d96e0e498 | [
"MIT"
] | null | null | null | import csv
import os
import glob
import time
# from astropy.coordinates import Angle
import numpy as np
import pandas as pd
import pymongo
import inspect
import json
import argparse
# import timeout_decorator
import signal
import traceback
import datetime
import pytz
from numba import jit
# import fastavro as avro
from... | 29.15493 | 103 | 0.5843 | import csv
import os
import glob
import time
import numpy as np
import pandas as pd
import pymongo
import inspect
import json
import argparse
import signal
import traceback
import datetime
import pytz
from numba import jit
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures import ProcessPoolEx... | true | true |
f743693ee4abb9c8f756c8bf8776f942eb9e6bd6 | 1,434 | py | Python | utils.py | abhijeetdhupia/WCE-Classification | 043805fe54d14ef3d24735375df1f387c62e7896 | [
"MIT"
] | null | null | null | utils.py | abhijeetdhupia/WCE-Classification | 043805fe54d14ef3d24735375df1f387c62e7896 | [
"MIT"
] | null | null | null | utils.py | abhijeetdhupia/WCE-Classification | 043805fe54d14ef3d24735375df1f387c62e7896 | [
"MIT"
] | null | null | null | import torch
def calculate_topk_accuracy(y_pred, y, k = 4):
with torch.no_grad():
batch_size = y.shape[0]
_, top_pred = y_pred.topk(k, 1)
top_pred = top_pred.t()
correct = top_pred.eq(y.view(1, -1).expand_as(top_pred))
correct_1 = correct[:1].reshape(-1).float().sum(0, keep... | 26.555556 | 74 | 0.585077 | import torch
def calculate_topk_accuracy(y_pred, y, k = 4):
with torch.no_grad():
batch_size = y.shape[0]
_, top_pred = y_pred.topk(k, 1)
top_pred = top_pred.t()
correct = top_pred.eq(y.view(1, -1).expand_as(top_pred))
correct_1 = correct[:1].reshape(-1).float().sum(0, keep... | true | true |
f7436945a763d5707b89bf2264f9c079be3c7723 | 1,196 | py | Python | src/integrationtest/python/HelloWorld_tests.py | dan-hook/python-serverless-example | d881caa9a11a6941ed32db00e4971f42a4ecd4a8 | [
"Apache-2.0"
] | null | null | null | src/integrationtest/python/HelloWorld_tests.py | dan-hook/python-serverless-example | d881caa9a11a6941ed32db00e4971f42a4ecd4a8 | [
"Apache-2.0"
] | null | null | null | src/integrationtest/python/HelloWorld_tests.py | dan-hook/python-serverless-example | d881caa9a11a6941ed32db00e4971f42a4ecd4a8 | [
"Apache-2.0"
] | null | null | null | import boto3
import requests
import unittest
import os
class HelloWorldTests(unittest.TestCase):
stack_outputs = None
def get_stack_outputs(self):
if self.stack_outputs is None:
stack_name = "python-serverless-example-{}".format(os.getenv('SERVERLESS_STAGE',
... | 36.242424 | 100 | 0.617057 | import boto3
import requests
import unittest
import os
class HelloWorldTests(unittest.TestCase):
stack_outputs = None
def get_stack_outputs(self):
if self.stack_outputs is None:
stack_name = "python-serverless-example-{}".format(os.getenv('SERVERLESS_STAGE',
... | true | true |
f7436947b0127f7e035d1d3e1ed4f83760e00c34 | 2,214 | py | Python | tests/python/pants_test/help/test_help_formatter.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/help/test_help_formatter.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/help/test_help_formatter.py | dturner-tw/pants | 3a04f2e46bf2b8fb0a7999c09e4ffdf9057ed33f | [
"Apache-2.0"
] | 1 | 2019-06-10T17:24:34.000Z | 2019-06-10T17:24:34.000Z | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
fro... | 44.28 | 96 | 0.672087 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
from pants.help.help_formatter import HelpFormatter
from pants.help.help_info_extracter import OptionHelpInfo
class OptionHelpFormatterTest(unit... | true | true |
f74369816cf2947a9e9b65400c91d42c648ca3a5 | 652 | py | Python | pdf_id/pdfid/plugin_embeddedfile.py | CybercentreCanada/assemblyline-service-pdfid | 0a19cdbcae43aadfc7a68857dc3fa0ef3072b138 | [
"MIT"
] | 2 | 2021-06-18T14:57:45.000Z | 2021-12-15T05:48:22.000Z | pdf_id/pdfid/plugin_embeddedfile.py | CybercentreCanada/assemblyline-service-pdfid | 0a19cdbcae43aadfc7a68857dc3fa0ef3072b138 | [
"MIT"
] | 2 | 2021-10-05T17:50:37.000Z | 2022-02-02T16:40:23.000Z | pdf_id/pdfid/plugin_embeddedfile.py | CybercentreCanada/assemblyline-service-pdfid | 0a19cdbcae43aadfc7a68857dc3fa0ef3072b138 | [
"MIT"
] | 5 | 2020-12-02T20:02:28.000Z | 2022-02-02T13:35:04.000Z | #!/usr/bin/env python
"""
Modified by CSE to fit ASSEMBLYLINE service
"""
from pdf_id.pdfid.pdfid import cPluginParent, AddPlugin
# 2014/10/13
class cPDFiDEmbeddedFile(cPluginParent):
# onlyValidPDF = True
name = 'EmbeddedFile plugin'
def __init__(self, oPDFiD, options):
self.oPDFiD = oPDFiD
... | 24.148148 | 103 | 0.628834 |
from pdf_id.pdfid.pdfid import cPluginParent, AddPlugin
class cPDFiDEmbeddedFile(cPluginParent):
name = 'EmbeddedFile plugin'
def __init__(self, oPDFiD, options):
self.oPDFiD = oPDFiD
def Score(self):
if '/EmbeddedFile' in self.oPDFiD.keywords and self.oPDFiD.keywords['/EmbeddedFi... | true | true |
f7436bb2aadc7003fec51a91896446f5c57b793d | 8,505 | py | Python | src/main/git_log/buggy_commit.py | Anonymous633671/A-Comparison-on-Communication-and-Code-Dependency-Effects-on-Software-Code-Quality | 5a88f62513f9879178af3c5f763631b93e4f3054 | [
"MIT"
] | null | null | null | src/main/git_log/buggy_commit.py | Anonymous633671/A-Comparison-on-Communication-and-Code-Dependency-Effects-on-Software-Code-Quality | 5a88f62513f9879178af3c5f763631b93e4f3054 | [
"MIT"
] | null | null | null | src/main/git_log/buggy_commit.py | Anonymous633671/A-Comparison-on-Communication-and-Code-Dependency-Effects-on-Software-Code-Quality | 5a88f62513f9879178af3c5f763631b93e4f3054 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 31 12:49:38 2018
@author: suvod
"""
from main.git_log import git2repo
from main.api import api_access
import pygit2
import re
import pandas as pd
from datetime import datetime
import re, unicodedata
from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE
import os
from... | 40.5 | 272 | 0.594709 |
from main.git_log import git2repo
from main.api import api_access
import pygit2
import re
import pandas as pd
from datetime import datetime
import re, unicodedata
from pygit2 import GIT_SORT_TOPOLOGICAL, GIT_SORT_REVERSE
import os
from main.utils.utils import utils
import platform
import threading
from multiprocessin... | true | true |
f7436de7de952d5e4b075c3c737c7708e7f230a3 | 44,316 | py | Python | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/storage/azure-mgmt-storage/azure/mgmt/storage/v2017_10_01/aio/operations/_storage_accounts_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 52.820024 | 198 | 0.680544 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f7436f103bdfc286f12f97c4b40503edb739a721 | 990 | py | Python | 2115-find-all-possible-recipes-from-given-supplies/2115-find-all-possible-recipes-from-given-supplies.py | Dawit-Getachew/A2SV_Practice | 2fe06d725e0acfe668c6dae98fe3ef6e6e26ef61 | [
"MIT"
] | null | null | null | 2115-find-all-possible-recipes-from-given-supplies/2115-find-all-possible-recipes-from-given-supplies.py | Dawit-Getachew/A2SV_Practice | 2fe06d725e0acfe668c6dae98fe3ef6e6e26ef61 | [
"MIT"
] | null | null | null | 2115-find-all-possible-recipes-from-given-supplies/2115-find-all-possible-recipes-from-given-supplies.py | Dawit-Getachew/A2SV_Practice | 2fe06d725e0acfe668c6dae98fe3ef6e6e26ef61 | [
"MIT"
] | null | null | null | class Solution:
def findAllRecipes(self, recipes: List[str], ingredients: List[List[str]], supplies: List[str]) -> List[str]:
supplies, recipies = set(supplies), set(recipes)
indegree = {elem:0 for elem in recipies}
graph = defaultdict(list)
for i, recipie in enumerate(recipes):
... | 36.666667 | 113 | 0.50202 | class Solution:
def findAllRecipes(self, recipes: List[str], ingredients: List[List[str]], supplies: List[str]) -> List[str]:
supplies, recipies = set(supplies), set(recipes)
indegree = {elem:0 for elem in recipies}
graph = defaultdict(list)
for i, recipie in enumerate(recipes):
... | true | true |
f7436fe7cde07ea874b0eae2dc638ad03d094681 | 99 | py | Python | fpage/votes/__init__.py | nikolak/fpage | 064ae766156559a65186370cc458d799f0d441d3 | [
"Apache-2.0"
] | 3 | 2019-08-15T12:26:30.000Z | 2020-12-28T05:20:11.000Z | fpage/votes/__init__.py | nikolak/fpage | 064ae766156559a65186370cc458d799f0d441d3 | [
"Apache-2.0"
] | null | null | null | fpage/votes/__init__.py | nikolak/fpage | 064ae766156559a65186370cc458d799f0d441d3 | [
"Apache-2.0"
] | 2 | 2020-04-15T19:06:30.000Z | 2020-12-28T05:34:09.000Z | # encoding: utf-8
'''Votes module handles comment and thread votes posting/models'''
import views | 19.8 | 66 | 0.757576 |
import views | true | true |
f743702a1214ff2c806e4d5439beb61bf6ac15de | 717 | py | Python | stations/taiyuan/migrations/0001_initial.py | mathanzy/Station_Django | d6671b4d38d7fba8d829751dadee4834c1ed0bd1 | [
"MIT"
] | null | null | null | stations/taiyuan/migrations/0001_initial.py | mathanzy/Station_Django | d6671b4d38d7fba8d829751dadee4834c1ed0bd1 | [
"MIT"
] | null | null | null | stations/taiyuan/migrations/0001_initial.py | mathanzy/Station_Django | d6671b4d38d7fba8d829751dadee4834c1ed0bd1 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.3 on 2018-10-10 07:21
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='QueueLength',
fields=[
('id... | 28.68 | 115 | 0.560669 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='QueueLength',
fields=[
('id', models.AutoField(auto_created=True, primary_k... | true | true |
f743725c4ce825fa458d09238738076ee0e69fad | 5,284 | py | Python | Scripts/run_parallel_VC.py | pjain310/scRNAseq_Cell_Classification | 46d73ff257eef9974e1e425a52b30b61e96e3ca4 | [
"MIT"
] | 1 | 2020-07-19T13:34:32.000Z | 2020-07-19T13:34:32.000Z | Scripts/run_parallel_VC.py | pjain310/scRNAseq_Cell_Classification | 46d73ff257eef9974e1e425a52b30b61e96e3ca4 | [
"MIT"
] | null | null | null | Scripts/run_parallel_VC.py | pjain310/scRNAseq_Cell_Classification | 46d73ff257eef9974e1e425a52b30b61e96e3ca4 | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import time as tm
from joblib import Parallel, delayed
from sklearn.svm import LinearSVC
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from... | 38.289855 | 158 | 0.690575 | import os
import numpy as np
import pandas as pd
import time as tm
from joblib import Parallel, delayed
from sklearn.svm import LinearSVC
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from... | true | true |
f74373500dbdbec0a417e14fbbb448a6a741253f | 342 | py | Python | appendix/introduction.to.programming.with.turtle/4-1-1.custom.function.py | royqh1979/programming_with_python | 7e1e8f88381151b803b6ae6ebda9809d9cc6664a | [
"MIT"
] | 5 | 2019-03-06T12:28:47.000Z | 2022-01-06T14:06:02.000Z | appendix/introduction.to.programming.with.turtle/4-1-1.custom.function.py | royqh1979/programming_with_python | 7e1e8f88381151b803b6ae6ebda9809d9cc6664a | [
"MIT"
] | 6 | 2021-02-02T22:40:49.000Z | 2022-03-12T00:27:54.000Z | appendix/introduction.to.programming.with.turtle/4-1-1.custom.function.py | royqh1979/programming_with_python | 7e1e8f88381151b803b6ae6ebda9809d9cc6664a | [
"MIT"
] | 4 | 2019-03-06T14:29:25.000Z | 2020-06-02T15:16:40.000Z | from easygraphics.turtle import *
def arcl(side, degree):
for i in range(degree):
fd(side)
lt(1)
def arcr(side, degree):
for i in range(degree):
fd(side)
rt(1)
def main():
create_world(800, 600)
set_speed(50)
arcr(2, 90)
arcl(2, 90)
pause()
close_w... | 13.153846 | 33 | 0.561404 | from easygraphics.turtle import *
def arcl(side, degree):
for i in range(degree):
fd(side)
lt(1)
def arcr(side, degree):
for i in range(degree):
fd(side)
rt(1)
def main():
create_world(800, 600)
set_speed(50)
arcr(2, 90)
arcl(2, 90)
pause()
close_w... | true | true |
f7437361ad1aed1ce312f8cd9af797bd8f7e0feb | 12,447 | py | Python | tests/test_03_csv_crash.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 51 | 2015-09-14T16:31:02.000Z | 2022-01-12T17:56:53.000Z | tests/test_03_csv_crash.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 10 | 2017-11-15T15:10:05.000Z | 2022-01-19T07:36:43.000Z | tests/test_03_csv_crash.py | jdfekete/progressivis | 3bc79ce229cd628ef0aa4663136a674743697b47 | [
"BSD-2-Clause"
] | 5 | 2017-11-14T20:20:56.000Z | 2020-01-22T06:26:51.000Z | from . import ProgressiveTest, skip, skipIf
from progressivis.io import CSVLoader
from progressivis.table.constant import Constant
from progressivis.table.table import Table
from progressivis.datasets import (get_dataset, get_dataset_bz2,
get_dataset_gz,
... | 39.018809 | 123 | 0.667711 | from . import ProgressiveTest, skip, skipIf
from progressivis.io import CSVLoader
from progressivis.table.constant import Constant
from progressivis.table.table import Table
from progressivis.datasets import (get_dataset, get_dataset_bz2,
get_dataset_gz,
... | true | true |
f743752b3769f242623858e3f1730be2b76ba609 | 4,729 | py | Python | examples/Mentor/07.2.TextureCoordinates.py | cclauss/pivy | 55de2ba4dd32f62ce2d4e33ca28459cf3ea5167a | [
"ISC"
] | 3 | 2016-11-21T18:26:16.000Z | 2019-09-19T14:17:17.000Z | examples/Mentor/07.2.TextureCoordinates.py | cclauss/pivy | 55de2ba4dd32f62ce2d4e33ca28459cf3ea5167a | [
"ISC"
] | 17 | 2016-01-27T17:28:47.000Z | 2017-06-12T18:17:42.000Z | examples/Mentor/07.2.TextureCoordinates.py | cclauss/pivy | 55de2ba4dd32f62ce2d4e33ca28459cf3ea5167a | [
"ISC"
] | 4 | 2016-08-12T01:11:47.000Z | 2018-02-02T17:43:29.000Z | #!/usr/bin/env python
###
# Copyright (c) 2002-2007 Systems in Motion
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS I... | 33.302817 | 75 | 0.67287 |
import sys
from pivy.coin import *
from pivy.sogui import *
IV_STRICT = 1
def main():
myWindow = SoGui.init(sys.argv[0])
if myWindow == None: sys.exit(1)
root = SoSeparator()
brick = SoTexture2()
root.addChild(brick)
brick.filename = "brick.1.rgb"
if ... | true | true |
f74375807dded012e0f6ce347f7108f48778f126 | 969 | py | Python | the_grandest_step_of_them_all.py | sakurusurya2000/FOOBAR | 60601d40d5669e41b799ec704127136744657bf2 | [
"MIT"
] | null | null | null | the_grandest_step_of_them_all.py | sakurusurya2000/FOOBAR | 60601d40d5669e41b799ec704127136744657bf2 | [
"MIT"
] | null | null | null | the_grandest_step_of_them_all.py | sakurusurya2000/FOOBAR | 60601d40d5669e41b799ec704127136744657bf2 | [
"MIT"
] | null | null | null | from math import sqrt, floor
def solution(n):
if n<3 or n>200:
return 0
else:
sum = 0
cache = []
for x in range(0, n):
temp = []
for y in range(0, n):
temp.append(-1)
cache.append(temp)
for i in ran... | 20.617021 | 61 | 0.470588 | from math import sqrt, floor
def solution(n):
if n<3 or n>200:
return 0
else:
sum = 0
cache = []
for x in range(0, n):
temp = []
for y in range(0, n):
temp.append(-1)
cache.append(temp)
for i in ran... | true | true |
f74376dd035233eb9f36beaef1f63a0881400c7e | 486 | py | Python | Test_webdriver.py | betisb/WebProgrammin_I | 6e2e4525c8d7766d65785e30bb43234cd7d829ef | [
"MIT"
] | null | null | null | Test_webdriver.py | betisb/WebProgrammin_I | 6e2e4525c8d7766d65785e30bb43234cd7d829ef | [
"MIT"
] | null | null | null | Test_webdriver.py | betisb/WebProgrammin_I | 6e2e4525c8d7766d65785e30bb43234cd7d829ef | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
browser = webdriver.Chrome()
browser.get("http://www.python.org")
assert "Python" in browser.title
time.sleep(1)
search_box = browser.find_element_by_name("q")
search_box.clear()
search_box.send_keys("pycon")
time.sleep(2)
searc... | 27 | 53 | 0.794239 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
browser = webdriver.Chrome()
browser.get("http://www.python.org")
assert "Python" in browser.title
time.sleep(1)
search_box = browser.find_element_by_name("q")
search_box.clear()
search_box.send_keys("pycon")
time.sleep(2)
searc... | true | true |
f7437810dc99cca41d615130a9e6c1648dde8b8f | 29,612 | py | Python | onmt/inputters/inputter.py | EstelleHuang666/OpenNMT-py | f7a239086d0db156535f3f5db9ed7060291485e8 | [
"MIT"
] | null | null | null | onmt/inputters/inputter.py | EstelleHuang666/OpenNMT-py | f7a239086d0db156535f3f5db9ed7060291485e8 | [
"MIT"
] | null | null | null | onmt/inputters/inputter.py | EstelleHuang666/OpenNMT-py | f7a239086d0db156535f3f5db9ed7060291485e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import glob
import os
import codecs
import math
from collections import Counter, defaultdict
from itertools import chain, cycle
import torch
import torchtext.data
from torchtext.data import Field, RawField
from torchtext.vocab import Vocab
from torchtext.data.utils import RandomShuffler
from ... | 36.648515 | 79 | 0.608605 |
import glob
import os
import codecs
import math
from collections import Counter, defaultdict
from itertools import chain, cycle
import torch
import torchtext.data
from torchtext.data import Field, RawField
from torchtext.vocab import Vocab
from torchtext.data.utils import RandomShuffler
from onmt.inputters.text_dat... | true | true |
f7437832d8b57401d05044db45944540b9ad63d6 | 148 | py | Python | parla_task/__init__.py | UTexas-PSAAP/parla_task | 91cf2091727ea817fe4b641e4dd54ef40cc2889f | [
"BSD-2-Clause"
] | null | null | null | parla_task/__init__.py | UTexas-PSAAP/parla_task | 91cf2091727ea817fe4b641e4dd54ef40cc2889f | [
"BSD-2-Clause"
] | null | null | null | parla_task/__init__.py | UTexas-PSAAP/parla_task | 91cf2091727ea817fe4b641e4dd54ef40cc2889f | [
"BSD-2-Clause"
] | null | null | null | from .task_wrappers import task, create_task, run_generation_task
from .gpu_map import bind_devices as _bind_devices, get_device
_bind_devices()
| 24.666667 | 65 | 0.837838 | from .task_wrappers import task, create_task, run_generation_task
from .gpu_map import bind_devices as _bind_devices, get_device
_bind_devices()
| true | true |
f7437a860b9c386929842d5c780ea9418163a116 | 2,027 | py | Python | common/database.py | perrycharlton/forms | 4e2d18538a0b08ebdd88a4ddad8fb614f04b1a51 | [
"MIT"
] | null | null | null | common/database.py | perrycharlton/forms | 4e2d18538a0b08ebdd88a4ddad8fb614f04b1a51 | [
"MIT"
] | null | null | null | common/database.py | perrycharlton/forms | 4e2d18538a0b08ebdd88a4ddad8fb614f04b1a51 | [
"MIT"
] | null | null | null | from config import BaseConfig
import gridfs
class Userdb:
client = BaseConfig.MONGOD_DATABASE_URI
# client = MongoClient('localhost:27017')
db = BaseConfig.DB_NAME
# db = 'users'
def __init__(self, coll):
# self.db = db
self.coll = coll
def conn(self):
return self.cli... | 26.671053 | 81 | 0.644302 | from config import BaseConfig
import gridfs
class Userdb:
client = BaseConfig.MONGOD_DATABASE_URI
db = BaseConfig.DB_NAME
def __init__(self, coll):
self.coll = coll
def conn(self):
return self.client[self.db][self.coll]
def create_user(self, user_details):
... | true | true |
f7437b37713fa41a261f55cc900a8bd1603957bb | 2,736 | py | Python | StackApp/env/lib/python2.7/site-packages/pylint/test/functional/ctor_arguments.py | jonathanmusila/StackOverflow-Lite | a9a03f129592c6f741eb4d1e608ca2db0e40bf11 | [
"MIT"
] | 35 | 2016-09-22T22:53:14.000Z | 2020-02-13T15:12:21.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/ctor_arguments.py | evantoh/patient-management-system | 6637eb1344775633759165260ed99843581c0e72 | [
"Unlicense"
] | 32 | 2018-05-01T05:24:43.000Z | 2022-03-11T23:20:39.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/ctor_arguments.py | evantoh/patient-management-system | 6637eb1344775633759165260ed99843581c0e72 | [
"Unlicense"
] | 88 | 2016-11-27T02:16:11.000Z | 2020-02-28T05:10:26.000Z | """Test function argument checker on __init__
Based on test/functional/arguments.py
"""
# pylint: disable=C0111,R0903,W0231
class Class1Arg(object):
def __init__(self, first_argument):
"""one argument function"""
class Class3Arg(object):
def __init__(self, first_argument, second_argument, third_argu... | 26.057143 | 78 | 0.695906 |
class Class1Arg(object):
def __init__(self, first_argument):
class Class3Arg(object):
def __init__(self, first_argument, second_argument, third_argument):
class ClassDefaultArg(object):
def __init__(self, one=1, two=2):
class Subclass1Arg(Class1Arg):
pass
class ClassAllArgs(Class1Arg):
def __... | true | true |
f7437b3af562a48e991b51d4731d8ad542a19e87 | 4,109 | py | Python | pyserver/bin/rpy2/robjects/tests/testNumpyConversions.py | lbouma/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 15 | 2015-05-06T05:11:48.000Z | 2021-12-03T14:56:58.000Z | pyserver/bin/rpy2/robjects/tests/testNumpyConversions.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | null | null | null | pyserver/bin/rpy2/robjects/tests/testNumpyConversions.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 8 | 2015-05-06T05:11:36.000Z | 2020-11-04T05:11:22.000Z | import unittest
import rpy2.robjects as robjects
r = robjects.r
try:
import numpy
has_numpy = True
import rpy2.robjects.numpy2ri as rpyn
except:
has_numpy = False
class MissingNumpyDummyTestCase(unittest.TestCase):
def testMissingNumpy(self):
self.assertTrue(False) # numpy is missing. No ... | 35.119658 | 85 | 0.612801 | import unittest
import rpy2.robjects as robjects
r = robjects.r
try:
import numpy
has_numpy = True
import rpy2.robjects.numpy2ri as rpyn
except:
has_numpy = False
class MissingNumpyDummyTestCase(unittest.TestCase):
def testMissingNumpy(self):
self.assertTrue(False)
class NumpyConversion... | true | true |
f7437ba531824e0a6d315d3380d2692ea81182cf | 5,923 | py | Python | signal_processing/timbral_inspection/resynthesize.py | sivaprakasaman/Python_Coding_Toolbox | 4e9ce98651f2a1c58d743f1375edd1e0d9c9ba76 | [
"MIT"
] | null | null | null | signal_processing/timbral_inspection/resynthesize.py | sivaprakasaman/Python_Coding_Toolbox | 4e9ce98651f2a1c58d743f1375edd1e0d9c9ba76 | [
"MIT"
] | 1 | 2022-01-09T22:52:04.000Z | 2022-01-09T22:52:04.000Z | stimulus_generation_resynthesized/resynthesize.py | sivaprakasaman/Timbre_SfN_2021 | 8bbcfb43eed49f49de7321e330f4b3943586038a | [
"MIT"
] | 1 | 2022-01-06T02:25:43.000Z | 2022-01-06T02:25:43.000Z | #Andrew Sivaprakasam
#Purdue University
#Email: asivapr@purdue.edu
#DESCRIPTION: Code written to isolate the magnitudes of harmonics of a
#given f_0 for a given audiofile/stimulus.
#Additional Dependencies: scipy, numpy, matplotlib
# pip3 install scipy
# pip3 install numpy
# pip3 install matplotlib
#May require ffmp... | 38.967105 | 358 | 0.606281 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
def extract_harmonics(fname, fs = 44100, f_0 = 440, n_harms = 3):
fs, x = wavfile.read(fname)
t_vect = np.arange(0,len(x))/fs
f_vect = np.arange(1,n_harms+1)*f_0;
x_sin = np.multiply(np.... | true | true |
f7437d16b396850b5a77fb665c76566ee35b86c4 | 1,782 | py | Python | stylegan/pretrained_example.py | britt0508/ExplainedKinshipCorrect | e0e255ff9531af1436bb9a9fe07256e72a0061f7 | [
"BSD-Source-Code"
] | null | null | null | stylegan/pretrained_example.py | britt0508/ExplainedKinshipCorrect | e0e255ff9531af1436bb9a9fe07256e72a0061f7 | [
"BSD-Source-Code"
] | null | null | null | stylegan/pretrained_example.py | britt0508/ExplainedKinshipCorrect | e0e255ff9531af1436bb9a9fe07256e72a0061f7 | [
"BSD-Source-Code"
] | null | null | null | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... | 36.367347 | 116 | 0.729517 |
import os
import pickle
import numpy as np
import PIL.Image
import dnnlib
import dnnlib.tflib as tflib
import config
def main():
tflib.init_tf()
url = 'https://drive.google.com/uc?id=1MEGjdvVpUsu1jB4zrXZN7Y4kBBOzizDQ'
with dnnlib.util.open_url(url, cache_dir=config.cache_dir) as f:
... | true | true |
f7437d3cd5afff64dcf055452f753f71bff5c2c5 | 11,144 | py | Python | IdentityAccessManager/dev_settings.py | silop4all/iam | 691316ca9ea7d3d10a3197b4d028e44e333c7060 | [
"Apache-2.0"
] | 2 | 2018-02-27T20:51:08.000Z | 2019-11-25T10:11:59.000Z | IdentityAccessManager/dev_settings.py | silop4all/iam | 691316ca9ea7d3d10a3197b4d028e44e333c7060 | [
"Apache-2.0"
] | null | null | null | IdentityAccessManager/dev_settings.py | silop4all/iam | 691316ca9ea7d3d10a3197b4d028e44e333c7060 | [
"Apache-2.0"
] | null | null | null | """
Django settings for IdentityAccessManager project.
"""
from os import path
PROJECT_ROOT = path.dirname(path.abspath(path.dirname(__file__)))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
HOST = {
'PROTOCOL': "http",
'IP': "192.168.1.2", #"192.168.1.68",
'PORT': 8000,
'PATH': ''
}
ALLOWED_... | 31.749288 | 276 | 0.629666 | from os import path
PROJECT_ROOT = path.dirname(path.abspath(path.dirname(__file__)))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
HOST = {
'PROTOCOL': "http",
'IP': "192.168.1.2",
'PORT': 8000,
'PATH': ''
}
ALLOWED_HOSTS = (
'*',
)
ADMINS = (
)
MANAGERS = ADMINS
OPENAM_HOST... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.