hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70783e180b4ca13da6bef7c7d91799a6f5e0db2 | 717 | py | Python | src/main/scripts/modules/json.py | Kynarth/ryrycipe | e689ba5859a3641c7ff9ea0b868280bfeaf34ec9 | [
"MIT"
] | null | null | null | src/main/scripts/modules/json.py | Kynarth/ryrycipe | e689ba5859a3641c7ff9ea0b868280bfeaf34ec9 | [
"MIT"
] | null | null | null | src/main/scripts/modules/json.py | Kynarth/ryrycipe | e689ba5859a3641c7ff9ea0b868280bfeaf34ec9 | [
"MIT"
] | null | null | null | class JsonRes:
craftplan = 'json/craftplan.json'
category_to_icon_en = 'json/en/category_to_icon_en.json'
words_en = 'json/en/words_en.json'
items_en = 'json/en/items_en.json'
material_to_icon_en = 'json/en/material_to_icon_en.json'
plans_en = 'json/en/plans_en.json'
materials_en = 'json/en/... | 39.833333 | 60 | 0.716876 | class JsonRes:
craftplan = 'json/craftplan.json'
category_to_icon_en = 'json/en/category_to_icon_en.json'
words_en = 'json/en/words_en.json'
items_en = 'json/en/items_en.json'
material_to_icon_en = 'json/en/material_to_icon_en.json'
plans_en = 'json/en/plans_en.json'
materials_en = 'json/en/... | true | true |
f70785ab9a87e136a0182edf5fd0d30f99328817 | 468 | py | Python | hc/wsgi.py | IfBkg/healthchecks | dcd8a74c6b0bcdb0065e7c27d5b6639823400562 | [
"BSD-3-Clause"
] | null | null | null | hc/wsgi.py | IfBkg/healthchecks | dcd8a74c6b0bcdb0065e7c27d5b6639823400562 | [
"BSD-3-Clause"
] | null | null | null | hc/wsgi.py | IfBkg/healthchecks | dcd8a74c6b0bcdb0065e7c27d5b6639823400562 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for hc project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from django.contrib.staticfiles.handlers ... | 26 | 78 | 0.801282 |
import os
from django.core.wsgi import get_wsgi_application
from django.contrib.staticfiles.handlers import StaticFilesHandler
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hc.settings")
application = StaticFilesHandler(get_wsgi_application())
| true | true |
f70785e5a2ed47f8a01bd91f0ef1227f58618b06 | 24,923 | py | Python | keepercommander/importer/lastpass/lastpass.py | dstromberg/Commander | db521cbd1ef0367e95e120011d12bfe9ad6034f8 | [
"MIT"
] | null | null | null | keepercommander/importer/lastpass/lastpass.py | dstromberg/Commander | db521cbd1ef0367e95e120011d12bfe9ad6034f8 | [
"MIT"
] | null | null | null | keepercommander/importer/lastpass/lastpass.py | dstromberg/Commander | db521cbd1ef0367e95e120011d12bfe9ad6034f8 | [
"MIT"
] | null | null | null | # _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2021 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
import calendar
import datetime
import getpass
import json
import logging
from typing import Optional, Li... | 41.677258 | 120 | 0.508968 | # |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2021 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
import calendar
import datetime
import getpass
import json
import logging
from typing import Optional, List
from ..importer import BaseImporter, Record, Folder, RecordField, Re... | true | true |
f70786a5c6e06916448c7c65a8d05f9d6a96e774 | 29,777 | py | Python | neutron/tests/functional/agent/l3/framework.py | swiftchao/neutron | f253d676b8f96b52f16382830349da50c3e366bc | [
"Apache-2.0"
] | 1 | 2018-10-19T01:48:37.000Z | 2018-10-19T01:48:37.000Z | neutron/tests/functional/agent/l3/framework.py | swiftchao/neutron | f253d676b8f96b52f16382830349da50c3e366bc | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/agent/l3/framework.py | swiftchao/neutron | f253d676b8f96b52f16382830349da50c3e366bc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 44.048817 | 79 | 0.634181 |
import copy
import functools
import textwrap
import mock
import netaddr
from neutron_lib import constants
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import uuidutils
import testtools
from neutron.agent.common import ovs_lib
from neutron.agent.l3 import agent as neutron_l3_agent
f... | true | true |
f707879e076cd18ac6fe4a33eb20c917b29be644 | 12,427 | py | Python | pressure_control_interface/utils/comm_handler.py | cbteeple/pressure_control_interface | 803491533da2bfd0cc980f3b9553c691b6dec0d8 | [
"MIT"
] | null | null | null | pressure_control_interface/utils/comm_handler.py | cbteeple/pressure_control_interface | 803491533da2bfd0cc980f3b9553c691b6dec0d8 | [
"MIT"
] | 10 | 2020-08-12T00:23:27.000Z | 2022-01-03T19:54:02.000Z | pressure_control_interface/utils/comm_handler.py | cbteeple/pressure_control_interface | 803491533da2bfd0cc980f3b9553c691b6dec0d8 | [
"MIT"
] | null | null | null | import serial
import time
from datetime import datetime
import sys
import os
import yaml
import csv
import re
from validate_commands import CommandValidator
def build_cmd_string(command, values=None, format="%0.3f"):
txt = command
if values is not None:
#print("%s \t %s"%(command, values))
i... | 31.381313 | 112 | 0.540114 | import serial
import time
from datetime import datetime
import sys
import os
import yaml
import csv
import re
from validate_commands import CommandValidator
def build_cmd_string(command, values=None, format="%0.3f"):
txt = command
if values is not None:
if isinstance(values, list) or isinsta... | true | true |
f70789ebeed4d28a5c9bc51ca8340e29d07e47a9 | 34,157 | py | Python | release/scripts/startup/bl_ui/properties_freestyle.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 39 | 2020-05-26T15:21:14.000Z | 2022-03-24T04:46:31.000Z | release/scripts/startup/bl_ui/properties_freestyle.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 7 | 2020-05-11T14:04:54.000Z | 2020-06-03T15:00:20.000Z | release/scripts/startup/bl_ui/properties_freestyle.py | rbabari/blender | 6daa85f14b2974abfc3d0f654c5547f487bb3b74 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2020-04-25T14:38:01.000Z | 2021-03-03T08:48:58.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 40.043376 | 105 | 0.581726 |
import bpy
from bpy.types import Menu, Panel, UIList
class RenderFreestyleButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
@classmethod
def poll(cls, context):
scene = context.scene
with_freestyle = bpy.app.build_options.freestyle
... | true | true |
f7078b2efc7f2c5bfe394f2cd6f4e657fe16fb16 | 50 | py | Python | mini_blockchain/__init__.py | aliciawyy/financial_machine_learning | 00c20c250976104dd8ea1484697064272c8231b7 | [
"MIT"
] | null | null | null | mini_blockchain/__init__.py | aliciawyy/financial_machine_learning | 00c20c250976104dd8ea1484697064272c8231b7 | [
"MIT"
] | null | null | null | mini_blockchain/__init__.py | aliciawyy/financial_machine_learning | 00c20c250976104dd8ea1484697064272c8231b7 | [
"MIT"
] | null | null | null | from .base import Block, GenesisBlock, BlockChain
| 25 | 49 | 0.82 | from .base import Block, GenesisBlock, BlockChain
| true | true |
f7078c0be67a7343ea85a08294eaad322d6610d2 | 35,863 | py | Python | sympy/solvers/pde.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 1 | 2021-06-24T09:01:18.000Z | 2021-06-24T09:01:18.000Z | sympy/solvers/pde.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 3 | 2021-02-28T03:58:40.000Z | 2021-03-07T06:12:47.000Z | sympy/solvers/pde.py | qcgm1978/sympy | cc46047f4449b525b7b0edd4c634bf93d6e7c83d | [
"BSD-3-Clause"
] | 1 | 2020-08-12T10:51:20.000Z | 2020-08-12T10:51:20.000Z | """
This module contains pdsolve() and different helper functions that it
uses. It is heavily inspired by the ode module and hence the basic
infrastructure remains the same.
**Functions in this module**
These are the user functions in this module:
- pdsolve() - Solves PDE's
- classify_pde() - Classif... | 35.26352 | 127 | 0.547249 | from itertools import combinations_with_replacement
from sympy.simplify import simplify from sympy.core import Add, S
from sympy.core.compatibility import reduce, is_sequence
from sympy.core.function import Function, expand, AppliedUndef, Subs
from sympy.core.relational import Equality, Eq
from sympy.core.symbol impor... | true | true |
f7078c443de8ebce4f491fccd4921a22ea0062f2 | 36,421 | py | Python | Packs/GroupIB_ThreatIntelligenceAttribution/Integrations/GroupIB_TIA_Feed/GroupIB_TIA_Feed.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/GroupIB_ThreatIntelligenceAttribution/Integrations/GroupIB_TIA_Feed/GroupIB_TIA_Feed.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/GroupIB_ThreatIntelligenceAttribution/Integrations/GroupIB_TIA_Feed/GroupIB_TIA_Feed.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
""" IMPORTS """
from typing import Dict, Generator, List, Optional, Tuple, Union
import dateparser
import urllib3
# Disable insecure warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
''' CON... | 42.949292 | 120 | 0.503775 | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from typing import Dict, Generator, List, Optional, Tuple, Union
import dateparser
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
COMMON_FIELD_TYP... | true | true |
f7078ca12c2ce382a8408308ee089ed0282cb5c2 | 2,632 | py | Python | corner/input/plot_field.py | bderembl/mitgcm_configs | 8aa0343fc56e9da831e7a8b857838c4f4a76aa9a | [
"MIT"
] | 1 | 2020-01-13T05:18:38.000Z | 2020-01-13T05:18:38.000Z | corner/input/plot_field.py | bderembl/mitgcm_configs | 8aa0343fc56e9da831e7a8b857838c4f4a76aa9a | [
"MIT"
] | null | null | null | corner/input/plot_field.py | bderembl/mitgcm_configs | 8aa0343fc56e9da831e7a8b857838c4f4a76aa9a | [
"MIT"
] | 5 | 2018-04-10T15:18:39.000Z | 2020-12-01T02:05:37.000Z | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import scipy.io.netcdf as netcdf
plt.ion()
flag_mov = 0
flag_traj = 0
dir0 = '../run/'
file1 = 'diags.0000000000.t001.nc'
file2 = 'grid.t001.nc'
f1 = netcdf.netcdf_file(dir0 + file1)
f2 = netcdf.netcdf_file(dir0 + file2)
x = f2.variables['... | 23.711712 | 83 | 0.599164 |
import numpy as np
import matplotlib.pyplot as plt
import scipy.io.netcdf as netcdf
plt.ion()
flag_mov = 0
flag_traj = 0
dir0 = '../run/'
file1 = 'diags.0000000000.t001.nc'
file2 = 'grid.t001.nc'
f1 = netcdf.netcdf_file(dir0 + file1)
f2 = netcdf.netcdf_file(dir0 + file2)
x = f2.variables['X'][:].copy()
y = f2.v... | true | true |
f7078d551863ea4d0444a10665588c50f03bd458 | 2,458 | py | Python | util/info_clima_inpe.py | Projeto-Integrador-BD/ivy-projeto-bd | 6796c6601c5b1465b0f7d49593f0575f01bc068f | [
"MIT"
] | 1 | 2020-05-14T03:41:01.000Z | 2020-05-14T03:41:01.000Z | util/info_clima_inpe.py | Projeto-Integrador-BD/ivy-projeto-bd | 6796c6601c5b1465b0f7d49593f0575f01bc068f | [
"MIT"
] | null | null | null | util/info_clima_inpe.py | Projeto-Integrador-BD/ivy-projeto-bd | 6796c6601c5b1465b0f7d49593f0575f01bc068f | [
"MIT"
] | 2 | 2020-05-16T21:31:31.000Z | 2020-06-25T01:05:55.000Z | from xml.dom import minidom
from urllib import request
import xmltodict, json
def get_informacoes_clima_7_dias(latitude, longitude):
endpoint_lat_lng = "http://servicos.cptec.inpe.br/XML/cidade/7dias/" + latitude + "/" + longitude + "/previsaoLatLon.xml"
response = request.urlopen(endpoint_lat_lng)
data =... | 35.623188 | 125 | 0.638731 | from xml.dom import minidom
from urllib import request
import xmltodict, json
def get_informacoes_clima_7_dias(latitude, longitude):
endpoint_lat_lng = "http://servicos.cptec.inpe.br/XML/cidade/7dias/" + latitude + "/" + longitude + "/previsaoLatLon.xml"
response = request.urlopen(endpoint_lat_lng)
data =... | true | true |
f7078d55c3300fc63750cbf84fa1adc5f89b9ed6 | 5,396 | py | Python | tests/integration/test_s3_zero_copy_replication/test.py | tianyiYoung/ClickHouse | 41012b5ba49df807af52fc17ab475a21fadda9b3 | [
"Apache-2.0"
] | 1 | 2021-06-25T07:09:27.000Z | 2021-06-25T07:09:27.000Z | tests/integration/test_s3_zero_copy_replication/test.py | tianyiYoung/ClickHouse | 41012b5ba49df807af52fc17ab475a21fadda9b3 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_s3_zero_copy_replication/test.py | tianyiYoung/ClickHouse | 41012b5ba49df807af52fc17ab475a21fadda9b3 | [
"Apache-2.0"
] | 1 | 2021-04-29T07:46:46.000Z | 2021-04-29T07:46:46.000Z | import logging
import time
import pytest
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
@pytest.fixture(scope="module")
def cluster():
try:
cluster = ClickHouseCluster(__file__)
cluster.add_instance... | 39.101449 | 136 | 0.661601 | import logging
import time
import pytest
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
@pytest.fixture(scope="module")
def cluster():
try:
cluster = ClickHouseCluster(__file__)
cluster.add_instance... | true | true |
f7078da757194a2016dd5bedc4aab55b97d82856 | 551 | py | Python | 07/part1.py | diabonas/aoc2021 | 7b79df77319a77eda1673b652dfed0493d74025e | [
"MIT"
] | null | null | null | 07/part1.py | diabonas/aoc2021 | 7b79df77319a77eda1673b652dfed0493d74025e | [
"MIT"
] | null | null | null | 07/part1.py | diabonas/aoc2021 | 7b79df77319a77eda1673b652dfed0493d74025e | [
"MIT"
] | null | null | null | #!/usr/bin/python
# SPDX-License-Identifier: MIT
import math
with open("input", "r") as file:
horizontal_positions = list(map(int, file.readline().split(",")))
cheapest = math.inf
for align in range(min(horizontal_positions), max(horizontal_positions) + 1):
fuel = sum(abs(p - align) for p in horizontal_posit... | 27.55 | 77 | 0.707804 |
import math
with open("input", "r") as file:
horizontal_positions = list(map(int, file.readline().split(",")))
cheapest = math.inf
for align in range(min(horizontal_positions), max(horizontal_positions) + 1):
fuel = sum(abs(p - align) for p in horizontal_positions)
if fuel < cheapest:
cheapest = ... | true | true |
f7078df968cb5fab7c5b3b2f7582059257952574 | 4,973 | py | Python | agents/RashBot/Handling.py | inXS212/Saltie | 78224ecdcbe049c9a798c5cfac12c223efc0596f | [
"MIT"
] | null | null | null | agents/RashBot/Handling.py | inXS212/Saltie | 78224ecdcbe049c9a798c5cfac12c223efc0596f | [
"MIT"
] | null | null | null | agents/RashBot/Handling.py | inXS212/Saltie | 78224ecdcbe049c9a798c5cfac12c223efc0596f | [
"MIT"
] | null | null | null | from Util import *
def controls(s):
s.throttle = curve1((s.y - .63 * s.brakes * s.pyv / ((1 - s.pyv / 2300) * 3 + 1)) / 999)
s.steer = curve1(Range180(s.a - s.av / 55, 1))
s.pitch = regress(-s.i - s.iv / 17)
s.yaw = regress(Range180(s.a - s.av / 12, 1))
s.roll = regress(Range180(- s.r + s.rv / 2... | 33.829932 | 92 | 0.465916 | from Util import *
def controls(s):
s.throttle = curve1((s.y - .63 * s.brakes * s.pyv / ((1 - s.pyv / 2300) * 3 + 1)) / 999)
s.steer = curve1(Range180(s.a - s.av / 55, 1))
s.pitch = regress(-s.i - s.iv / 17)
s.yaw = regress(Range180(s.a - s.av / 12, 1))
s.roll = regress(Range180(- s.r + s.rv / 2... | true | true |
f7078e8537d57e0975183b3c74fcab4086d16eb4 | 650 | py | Python | bittrex_websocket/summary_state.py | ericsomdahl/python-bittrex-websocket | 6c8982dd48fac4f4c94cceaaf05b0c90ec8357e0 | [
"MIT"
] | 2 | 2017-12-03T08:16:32.000Z | 2018-12-02T09:00:25.000Z | bittrex_websocket/summary_state.py | ericsomdahl/python-bittrex-websocket | 6c8982dd48fac4f4c94cceaaf05b0c90ec8357e0 | [
"MIT"
] | null | null | null | bittrex_websocket/summary_state.py | ericsomdahl/python-bittrex-websocket | 6c8982dd48fac4f4c94cceaaf05b0c90ec8357e0 | [
"MIT"
] | 3 | 2018-01-09T03:12:51.000Z | 2020-07-10T23:54:36.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# bittrex_websocket/summary_state.py
# Stanislav Lazarov
from time import sleep
from bittrex_websocket.websocket_client import BittrexSocket
if __name__ == "__main__":
class MyBittrexSocket(BittrexSocket):
def on_open(self):
self.client_callbacks = [... | 22.413793 | 69 | 0.621538 |
from time import sleep
from bittrex_websocket.websocket_client import BittrexSocket
if __name__ == "__main__":
class MyBittrexSocket(BittrexSocket):
def on_open(self):
self.client_callbacks = ['updateSummaryState']
def on_debug(self, **kwargs):
pass
def on_messa... | true | true |
f7078e9519a8851ed45a7599f584a6bcaa1ad9db | 7,948 | py | Python | autotest/test_gwf_maw04.py | kzeiler/modflow6 | a185d95b91985e965f8a04ae353305dff19b9637 | [
"CC0-1.0"
] | null | null | null | autotest/test_gwf_maw04.py | kzeiler/modflow6 | a185d95b91985e965f8a04ae353305dff19b9637 | [
"CC0-1.0"
] | null | null | null | autotest/test_gwf_maw04.py | kzeiler/modflow6 | a185d95b91985e965f8a04ae353305dff19b9637 | [
"CC0-1.0"
] | null | null | null | import os
import pytest
import sys
import numpy as np
try:
import pymake
except:
msg = "Error. Pymake package is not available.\n"
msg += "Try installing using the following command:\n"
msg += " pip install https://github.com/modflowpy/pymake/zipball/master"
raise Exception(msg)
try:
import fl... | 26.58194 | 76 | 0.589834 | import os
import pytest
import sys
import numpy as np
try:
import pymake
except:
msg = "Error. Pymake package is not available.\n"
msg += "Try installing using the following command:\n"
msg += " pip install https://github.com/modflowpy/pymake/zipball/master"
raise Exception(msg)
try:
import fl... | true | true |
f7078ed238233ef19cc666f9050de7d121c9cc2d | 6,652 | py | Python | selfdrive/car/interfaces.py | Neptos/openpilot | 01914a1a91ade18bd7aead99e7d1bf38cd22ad89 | [
"MIT"
] | 5 | 2020-12-26T17:21:31.000Z | 2021-05-11T23:09:10.000Z | selfdrive/car/interfaces.py | Neptos/openpilot | 01914a1a91ade18bd7aead99e7d1bf38cd22ad89 | [
"MIT"
] | 1 | 2021-02-03T00:51:55.000Z | 2021-02-03T00:51:55.000Z | selfdrive/car/interfaces.py | Neptos/openpilot | 01914a1a91ade18bd7aead99e7d1bf38cd22ad89 | [
"MIT"
] | 11 | 2020-12-26T17:44:42.000Z | 2021-04-06T19:59:25.000Z | import os
import time
from cereal import car
from common.kalman.simple_kalman import KF1D
from common.realtime import DT_CTRL
from selfdrive.car import gen_empty_fingerprint
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.events import Events
from selfdrive.controls.lib.vehicle_model import V... | 35.010526 | 138 | 0.704299 | import os
import time
from cereal import car
from common.kalman.simple_kalman import KF1D
from common.realtime import DT_CTRL
from selfdrive.car import gen_empty_fingerprint
from selfdrive.config import Conversions as CV
from selfdrive.controls.lib.events import Events
from selfdrive.controls.lib.vehicle_model import V... | true | true |
f7078ff5d6f47f04b96fa0641ac3d8233e238b90 | 1,868 | py | Python | utils/compute_algorithm_rank.py | aseldawy/deep-spatial-join | ce0e8e08f49b05e972287c6f4f50272735e04e60 | [
"Apache-2.0"
] | 6 | 2021-12-17T22:19:25.000Z | 2022-03-17T23:35:04.000Z | utils/compute_algorithm_rank.py | aseldawy/deep-spatial-join | ce0e8e08f49b05e972287c6f4f50272735e04e60 | [
"Apache-2.0"
] | null | null | null | utils/compute_algorithm_rank.py | aseldawy/deep-spatial-join | ce0e8e08f49b05e972287c6f4f50272735e04e60 | [
"Apache-2.0"
] | 2 | 2021-01-26T04:17:43.000Z | 2021-02-16T16:10:13.000Z | import operator
def main():
print ('Compute algorithm rank')
f = open('../data/join_results/sj.12_30.log.csv')
output_f = open('../data/join_results/sj.12_30.log.ranked.csv', 'w')
header = f.readline()
header = header.strip()
header += ',1st time,2nd time,3rd time,4th time, 1st #splits,2nd #sp... | 36.627451 | 103 | 0.599036 | import operator
def main():
print ('Compute algorithm rank')
f = open('../data/join_results/sj.12_30.log.csv')
output_f = open('../data/join_results/sj.12_30.log.ranked.csv', 'w')
header = f.readline()
header = header.strip()
header += ',1st time,2nd time,3rd time,4th time, 1st #splits,2nd #sp... | true | true |
f70790bdabc2c7fe01362649f171682a1a2e2577 | 321 | py | Python | 03 - Linux Security/q6/hashme.py | HirumalPriyashan/linux-training | 6ccfe572c0d7d36cb67b685ddb5ee82b5c3667c1 | [
"MIT"
] | 2 | 2021-09-15T14:21:26.000Z | 2022-01-24T13:14:42.000Z | 03 - Linux Security/q6/hashme.py | HirumalPriyashan/linux-training | 6ccfe572c0d7d36cb67b685ddb5ee82b5c3667c1 | [
"MIT"
] | null | null | null | 03 - Linux Security/q6/hashme.py | HirumalPriyashan/linux-training | 6ccfe572c0d7d36cb67b685ddb5ee82b5c3667c1 | [
"MIT"
] | null | null | null | import sys
import hashlib
def check(args):
if len(args) != 2:
print("usage hashme.py <phrase>")
return False
return True
def main(phrase):
salt ='Km5d5ivMy8iexuHcZrsD'
hash_obj = hashlib.pbkdf2_hmac('sha512', phrase.encode(), salt.encode(), 200000)
print(hash_obj.hex())
if check(sys.argv): main(sys.argv[1])... | 21.4 | 81 | 0.71028 | import sys
import hashlib
def check(args):
if len(args) != 2:
print("usage hashme.py <phrase>")
return False
return True
def main(phrase):
salt ='Km5d5ivMy8iexuHcZrsD'
hash_obj = hashlib.pbkdf2_hmac('sha512', phrase.encode(), salt.encode(), 200000)
print(hash_obj.hex())
if check(sys.argv): main(sys.argv[1])... | true | true |
f707919fa3236f64303228d43dfff91d42e6dab5 | 3,155 | py | Python | doc/conf.py | mango-db/mut | 3df98c17b0c5ea0b6101fe2c0e1b36ebdf97412e | [
"Apache-2.0"
] | 10 | 2017-05-09T19:38:34.000Z | 2022-01-21T00:02:03.000Z | doc/conf.py | mango-db/mut | 3df98c17b0c5ea0b6101fe2c0e1b36ebdf97412e | [
"Apache-2.0"
] | 7 | 2017-08-21T21:41:44.000Z | 2021-11-19T18:09:13.000Z | doc/conf.py | mango-db/mut | 3df98c17b0c5ea0b6101fe2c0e1b36ebdf97412e | [
"Apache-2.0"
] | 12 | 2016-10-13T14:42:50.000Z | 2022-01-13T13:51:53.000Z | # -*- coding: utf-8 -*-
#
# MongoDB documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 3 09:58:40 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
import sys
import os
import datetime
from sphinx.errors import SphinxError
try:
tags
except Na... | 25.443548 | 80 | 0.602219 |
import sys
import os
import datetime
from sphinx.errors import SphinxError
try:
tags
except NameError:
class Tags(object):
def has(self, *args):
return False
tags = Tags()
needs_sphinx = '1.0'
extensions = [
'sphinx.ext.extlinks',
'sphinx.ext.todo',
]
locale_dirs = []
get... | true | true |
f70791fca69d0f3ad4a9aa5995b5670291a02bb6 | 1,329 | py | Python | tests/test_dragonfly.py | certego/pydragonfly | 18dcbd78f07e0b6c09d536d45ba4051106c4f5a5 | [
"BSD-3-Clause"
] | null | null | null | tests/test_dragonfly.py | certego/pydragonfly | 18dcbd78f07e0b6c09d536d45ba4051106c4f5a5 | [
"BSD-3-Clause"
] | 15 | 2021-10-21T10:39:23.000Z | 2022-03-29T04:19:25.000Z | tests/test_dragonfly.py | certego/pydragonfly | 18dcbd78f07e0b6c09d536d45ba4051106c4f5a5 | [
"BSD-3-Clause"
] | null | null | null | from unittest.mock import patch
from pydragonfly.sdk.const import ANALYZED, MALICIOUS
from tests.mock_utils import MockAPIResponse
from tests.resources import APIResourceBaseTestCase
from tests.resources.test_analysis import AnalysisResultTestCase
class DragonflyTestCase(APIResourceBaseTestCase):
@property
d... | 34.973684 | 85 | 0.714823 | from unittest.mock import patch
from pydragonfly.sdk.const import ANALYZED, MALICIOUS
from tests.mock_utils import MockAPIResponse
from tests.resources import APIResourceBaseTestCase
from tests.resources.test_analysis import AnalysisResultTestCase
class DragonflyTestCase(APIResourceBaseTestCase):
@property
d... | true | true |
f70791fdb2757566982298ffb1bbf9b871483305 | 5,722 | py | Python | src/generator.py | Mtortolani/slack-backend | 11b1650c111eb163a8ef3bf75a33fb4aeeccf300 | [
"MIT"
] | null | null | null | src/generator.py | Mtortolani/slack-backend | 11b1650c111eb163a8ef3bf75a33fb4aeeccf300 | [
"MIT"
] | null | null | null | src/generator.py | Mtortolani/slack-backend | 11b1650c111eb163a8ef3bf75a33fb4aeeccf300 | [
"MIT"
] | null | null | null | from email import generator
from os import listdir
from os.path import isfile, join
import numpy as np
import random
import string
from pymongo import MongoClient
from models.user import User
from models.channel import *
from models.workspace import Workspace
from models.settings import *
# Setup Mongo client
class M... | 41.165468 | 151 | 0.653792 | from email import generator
from os import listdir
from os.path import isfile, join
import numpy as np
import random
import string
from pymongo import MongoClient
from models.user import User
from models.channel import *
from models.workspace import Workspace
from models.settings import *
class MongoDatabase:
def... | true | true |
f7079305ae82d491841a452c63bc1084747dc7d0 | 6,620 | py | Python | google/cloud/forseti/scanner/scanners/groups_settings_scanner.py | darrellkuhn/forseti-security | b54faf68d869842e8a43472ff980e28e2ce8d3c6 | [
"Apache-2.0"
] | null | null | null | google/cloud/forseti/scanner/scanners/groups_settings_scanner.py | darrellkuhn/forseti-security | b54faf68d869842e8a43472ff980e28e2ce8d3c6 | [
"Apache-2.0"
] | 1 | 2020-11-10T22:15:54.000Z | 2020-11-10T22:15:54.000Z | google/cloud/forseti/scanner/scanners/groups_settings_scanner.py | darrellkuhn/forseti-security | b54faf68d869842e8a43472ff980e28e2ce8d3c6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security 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 ap... | 40.613497 | 79 | 0.616465 |
import json
from google.cloud.forseti.common.gcp_type import groups_settings
from google.cloud.forseti.common.util import logger
from google.cloud.forseti.scanner.audit import groups_settings_rules_engine
from google.cloud.forseti.scanner.scanners import base_scanner
LOGGER = logger.get_logger(__name__)
class Gro... | true | true |
f7079479714dd2df0cbf8ce1a4319bd654929be3 | 1,638 | py | Python | utest/api/test_exposed_api.py | moto-timo/robotframework | 1a26bfc77ea295e298175cd665b5aee0dcbb6699 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | utest/api/test_exposed_api.py | moto-timo/robotframework | 1a26bfc77ea295e298175cd665b5aee0dcbb6699 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | utest/api/test_exposed_api.py | moto-timo/robotframework | 1a26bfc77ea295e298175cd665b5aee0dcbb6699 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import unittest
from os.path import abspath, join
from robot import api, model, parsing, reporting, result, running
from robot.utils.asserts import assert_equals
class TestExposedApi(unittest.TestCase):
def test_test_case_file(self):
assert_equals(api.TestCaseFile, parsing.TestCaseFile)
def test_... | 30.90566 | 88 | 0.721001 | import unittest
from os.path import abspath, join
from robot import api, model, parsing, reporting, result, running
from robot.utils.asserts import assert_equals
class TestExposedApi(unittest.TestCase):
def test_test_case_file(self):
assert_equals(api.TestCaseFile, parsing.TestCaseFile)
def test_... | true | true |
f707956a41547e296589d686b077ac113a8ab01e | 537 | py | Python | images/thumbs/resize.py | GiulioC/GiulioC.github.io | 8c73c3492682a2830f3552d71b12e5671370a5f4 | [
"CC-BY-3.0"
] | null | null | null | images/thumbs/resize.py | GiulioC/GiulioC.github.io | 8c73c3492682a2830f3552d71b12e5671370a5f4 | [
"CC-BY-3.0"
] | null | null | null | images/thumbs/resize.py | GiulioC/GiulioC.github.io | 8c73c3492682a2830f3552d71b12e5671370a5f4 | [
"CC-BY-3.0"
] | null | null | null | from PIL import Image
import os
percent = 0.5
for file_name in os.listdir("../foto/"):
if file_name == "pic8.jpg":
img = Image.open("../foto/"+str(file_name))
if img.size[0] > img.size[1]:
#foto orizzontale
hsize = int((float(img.size[0]) * float(percent)))
vsize = int((float(img.size[1]) * float(perce... | 26.85 | 53 | 0.636872 | from PIL import Image
import os
percent = 0.5
for file_name in os.listdir("../foto/"):
if file_name == "pic8.jpg":
img = Image.open("../foto/"+str(file_name))
if img.size[0] > img.size[1]:
hsize = int((float(img.size[0]) * float(percent)))
vsize = int((float(img.size[1]) * float(percent)))
else:
... | true | true |
f70796526017f9efdb2926f8a2f313915650ea0a | 453 | py | Python | sql/makedb.py | amenoyoya/pyrpn | 5174cf90f9dc1c43df2d04a0545ce96fe2a434ce | [
"MIT"
] | null | null | null | sql/makedb.py | amenoyoya/pyrpn | 5174cf90f9dc1c43df2d04a0545ce96fe2a434ce | [
"MIT"
] | null | null | null | sql/makedb.py | amenoyoya/pyrpn | 5174cf90f9dc1c43df2d04a0545ce96fe2a434ce | [
"MIT"
] | null | null | null | import sqlite3
from contextlib import closing
with closing(sqlite3.connect('sample.db')) as conn:
c = conn.cursor()
c.execute('create table users (id integer primary key, name varchar, age integer, gender varchar)')
c.executemany('insert into users (name, age, gender) values (?, ?, ?)', [
('Alex', ... | 32.357143 | 103 | 0.593819 | import sqlite3
from contextlib import closing
with closing(sqlite3.connect('sample.db')) as conn:
c = conn.cursor()
c.execute('create table users (id integer primary key, name varchar, age integer, gender varchar)')
c.executemany('insert into users (name, age, gender) values (?, ?, ?)', [
('Alex', ... | true | true |
f70796987ba6b1df037b3a85288d3b9336d7b3b7 | 1,066 | py | Python | onmt/tests/test_attention.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | 2 | 2019-07-30T06:50:21.000Z | 2020-02-05T17:42:06.000Z | onmt/tests/test_attention.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | 1 | 2019-08-20T08:57:21.000Z | 2019-08-21T08:49:48.000Z | onmt/tests/test_attention.py | deep-spin/SIGMORPHON2019 | 60cf3b53be42e76238e7928405b2916cd9aed6c4 | [
"MIT"
] | null | null | null | """
Here come the tests for attention types and their compatibility
"""
import unittest
import torch
from torch.autograd import Variable
import onmt
class TestAttention(unittest.TestCase):
def test_masked_global_attention(self):
source_lengths = torch.IntTensor([7, 3, 5, 2])
# illegal_weights_m... | 28.810811 | 74 | 0.578799 | import unittest
import torch
from torch.autograd import Variable
import onmt
class TestAttention(unittest.TestCase):
def test_masked_global_attention(self):
source_lengths = torch.IntTensor([7, 3, 5, 2])
batch_size = source_lengths.size(0)
dim = ... | true | true |
f70796dac00ff61d01f1195184eb507855798a0c | 8,878 | py | Python | moog/env_wrappers/logger.py | jazlab/moog.github.io | 3e89e46a5918d59475851f9d4f1558956c110d38 | [
"Apache-2.0",
"MIT"
] | 22 | 2021-02-26T18:19:35.000Z | 2022-03-05T19:01:00.000Z | moog/env_wrappers/logger.py | jazlab/moog.github.io | 3e89e46a5918d59475851f9d4f1558956c110d38 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-04-01T06:15:02.000Z | 2021-04-23T13:14:12.000Z | moog/env_wrappers/logger.py | jazlab/moog.github.io | 3e89e46a5918d59475851f9d4f1558956c110d38 | [
"Apache-2.0",
"MIT"
] | 2 | 2021-05-02T02:20:39.000Z | 2021-05-06T16:24:35.000Z | """Environment wrapper class for logging episodes.
This can be used to record data from a subject playing the task. See
../../moog_demos/restore_logged_data.py for an example of how to read log files.
Note: This logger records everything about the environment, which can be a lot
of data (depending on the task). If yo... | 39.457778 | 80 | 0.614553 |
import copy
from datetime import datetime
import json
import logging
import numpy as np
import os
import time
from moog import env_wrappers
from moog import sprite
_FILENAME_ZFILL = 5
class VertexLogging():
NEVER = 'NEVER'
ALWAYS = 'ALWAYS'
WHEN_NECESSARY = 'WHEN_NECESSARY'
def _serialize(x):
if ... | true | true |
f707972a59bc041da7ae5f9e61e1bed189a32c66 | 7,271 | py | Python | salt/states/beacon.py | nizD/salt | bbe135d62d8d8b4e4a7d0362097e1b3a3b092bed | [
"Apache-2.0"
] | 1 | 2020-12-28T09:48:52.000Z | 2020-12-28T09:48:52.000Z | salt/states/beacon.py | nizD/salt | bbe135d62d8d8b4e4a7d0362097e1b3a3b092bed | [
"Apache-2.0"
] | 2 | 2021-04-30T21:36:41.000Z | 2021-12-13T20:50:09.000Z | salt/states/beacon.py | nizD/salt | bbe135d62d8d8b4e4a7d0362097e1b3a3b092bed | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Management of the Salt beacons
==============================
.. versionadded:: 2015.8.0
.. code-block:: yaml
ps:
beacon.present:
- save: True
- enable: False
- services:
salt-master: running
apache2: stopped
sh:
beacon.... | 30.809322 | 86 | 0.527438 | from __future__ import absolute_import, print_function, unicode_literals
from salt.ext import six
import logging
log = logging.getLogger(__name__)
def present(name,
save=False,
**kwargs):
ret = {'name': name,
'result': True,
'changes': {},
'comment': []}... | true | true |
f707986dc8a90584a7e3d4ebd3b0ed227a87eafe | 5,499 | py | Python | office365/runtime/odata/odata_batch_request.py | andrewcchoi/Office365-REST-Python-Client | 43db12ae532c804c75a3a34f7b0d7d79e30fdac3 | [
"MIT"
] | null | null | null | office365/runtime/odata/odata_batch_request.py | andrewcchoi/Office365-REST-Python-Client | 43db12ae532c804c75a3a34f7b0d7d79e30fdac3 | [
"MIT"
] | null | null | null | office365/runtime/odata/odata_batch_request.py | andrewcchoi/Office365-REST-Python-Client | 43db12ae532c804c75a3a34f7b0d7d79e30fdac3 | [
"MIT"
] | null | null | null | import json
import re
from email import message_from_bytes
from email.message import Message
from office365.runtime.client_request import ClientRequest
from office365.runtime.http.http_method import HttpMethod
from office365.runtime.http.request_options import RequestOptions
from office365.runtime.queries.batch_query ... | 36.90604 | 98 | 0.62084 | import json
import re
from email import message_from_bytes
from email.message import Message
from office365.runtime.client_request import ClientRequest
from office365.runtime.http.http_method import HttpMethod
from office365.runtime.http.request_options import RequestOptions
from office365.runtime.queries.batch_query ... | true | true |
f707990f74ebda389b8ac9fa17579186b3bc2ac7 | 1,945 | py | Python | setup.py | rec/streamy | 1db04d87b2bed4cfbcd653213033ec3c66ed5b9e | [
"MIT"
] | 1 | 2019-05-26T15:10:26.000Z | 2019-05-26T15:10:26.000Z | setup.py | rec/streamy | 1db04d87b2bed4cfbcd653213033ec3c66ed5b9e | [
"MIT"
] | null | null | null | setup.py | rec/streamy | 1db04d87b2bed4cfbcd653213033ec3c66ed5b9e | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import os, sys
# From here: http://pytest.org/2.2.4/goodpractises.html
class RunTests(TestCommand):
DIRECTORY = 'test'
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_a... | 30.390625 | 80 | 0.598458 | from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
import os, sys
class RunTests(TestCommand):
DIRECTORY = 'test'
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = [self.DIRECTORY]
self.test_suite = True
... | true | true |
f7079b75ade620f03f918b382e39e44f8ce865cd | 3,491 | py | Python | configs/_base_/models/hv_second_secfpn_kitti.py | ACIS2021/robust-point-clouds | 127860149d2f4bd2db6ae015af0be132c156dd34 | [
"Unlicense"
] | null | null | null | configs/_base_/models/hv_second_secfpn_kitti.py | ACIS2021/robust-point-clouds | 127860149d2f4bd2db6ae015af0be132c156dd34 | [
"Unlicense"
] | null | null | null | configs/_base_/models/hv_second_secfpn_kitti.py | ACIS2021/robust-point-clouds | 127860149d2f4bd2db6ae015af0be132c156dd34 | [
"Unlicense"
] | null | null | null | voxel_size = [0.05, 0.05, 0.1]
model = dict(
type='VoxelNet',
voxel_layer=dict(max_num_points=5,
point_cloud_range=[0, -40, -3, 70.4, 40, 1],
voxel_size=voxel_size,
max_voxels=(16000, 40000)),
voxel_encoder=dict(type='HardSimpleVFE'),
middl... | 40.126437 | 66 | 0.42452 | voxel_size = [0.05, 0.05, 0.1]
model = dict(
type='VoxelNet',
voxel_layer=dict(max_num_points=5,
point_cloud_range=[0, -40, -3, 70.4, 40, 1],
voxel_size=voxel_size,
max_voxels=(16000, 40000)),
voxel_encoder=dict(type='HardSimpleVFE'),
middl... | true | true |
f7079bdf572c6fb25d68de3ac7e2a061d2d86ca1 | 761 | py | Python | pycspr/api/get_switch_block.py | momipsl/pycspr | 82c1ca003525a3d205d2aa3b7da5d1ecd275e9b5 | [
"Apache-2.0"
] | 2 | 2021-04-14T13:49:20.000Z | 2021-07-06T22:07:02.000Z | pycspr/api/get_switch_block.py | momipsl/pycspr | 82c1ca003525a3d205d2aa3b7da5d1ecd275e9b5 | [
"Apache-2.0"
] | null | null | null | pycspr/api/get_switch_block.py | momipsl/pycspr | 82c1ca003525a3d205d2aa3b7da5d1ecd275e9b5 | [
"Apache-2.0"
] | 1 | 2021-04-15T12:52:42.000Z | 2021-04-15T12:52:42.000Z | import time
from pycspr.api.get_block import execute as get_block
def execute(
polling_interval_seconds: float = 1.0,
max_polling_time_seconds: float = 120.0
) -> dict:
"""Returns last finialised block in current era.
:param polling_interval_seconds: Time interval time (in seconds) before polli... | 26.241379 | 106 | 0.678055 | import time
from pycspr.api.get_block import execute as get_block
def execute(
polling_interval_seconds: float = 1.0,
max_polling_time_seconds: float = 120.0
) -> dict:
elapsed = 0.0
while True:
block = get_block()
if block["header"]["era_end"] is not None:
return blo... | true | true |
f7079e13e136fd4466c5ea492de342e7668711ba | 9,382 | py | Python | texar/tf/data/data/tfrecord_data_test.py | GingerBear/texar | 46e006f9349893a3015cd937bee9914c516e26af | [
"Apache-2.0"
] | 1 | 2019-08-14T02:54:45.000Z | 2019-08-14T02:54:45.000Z | texar/tf/data/data/tfrecord_data_test.py | GingerBear/texar | 46e006f9349893a3015cd937bee9914c516e26af | [
"Apache-2.0"
] | null | null | null | texar/tf/data/data/tfrecord_data_test.py | GingerBear/texar | 46e006f9349893a3015cd937bee9914c516e26af | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
"""
Unit tests for data related operations.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import copy
import shutil
import tempfile
import ssl
import tensorflow as ... | 37.983806 | 79 | 0.513537 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import copy
import shutil
import tempfile
import ssl
import tensorflow as tf
import texar.tf as tx
ssl._create_default_https_context = ssl._create... | true | true |
f7079e7234b39fe9146d60409999798817582d7d | 566 | py | Python | PythonBasics/NestedLoops/Exercise/train_trainers.py | achoraev/SoftUni | 0cc7db470a096cc33bbe0ca6bd90060b79120573 | [
"Apache-2.0"
] | null | null | null | PythonBasics/NestedLoops/Exercise/train_trainers.py | achoraev/SoftUni | 0cc7db470a096cc33bbe0ca6bd90060b79120573 | [
"Apache-2.0"
] | null | null | null | PythonBasics/NestedLoops/Exercise/train_trainers.py | achoraev/SoftUni | 0cc7db470a096cc33bbe0ca6bd90060b79120573 | [
"Apache-2.0"
] | null | null | null | people = int(input())
presentation = ""
total_score = 0
total_average = 0
count_presentation = 0
while True:
command = input()
if command == "Finish":
break
presentation = command
score = 0
count_presentation += 1
for i in range(0, people):
score += float(input())
... | 21.769231 | 61 | 0.632509 | people = int(input())
presentation = ""
total_score = 0
total_average = 0
count_presentation = 0
while True:
command = input()
if command == "Finish":
break
presentation = command
score = 0
count_presentation += 1
for i in range(0, people):
score += float(input())
... | true | true |
f7079eef1bd564c94d8e1deac535192b60d263c4 | 481 | py | Python | liveapp/loadtowns.py | derrick-gopher/livestockapp | 87d4b0a697e0c47e64d419c61141b9fe04dbf088 | [
"MIT"
] | 1 | 2018-05-22T18:42:58.000Z | 2018-05-22T18:42:58.000Z | liveapp/loadtowns.py | muriithiderro/livestockapp | 87d4b0a697e0c47e64d419c61141b9fe04dbf088 | [
"MIT"
] | 7 | 2020-06-05T17:45:19.000Z | 2022-01-13T00:41:59.000Z | liveapp/loadtowns.py | muriithiderro/livestockapp | 87d4b0a697e0c47e64d419c61141b9fe04dbf088 | [
"MIT"
] | 1 | 2020-01-12T21:09:51.000Z | 2020-01-12T21:09:51.000Z | import os
from django.contrib.gis.utils import LayerMapping
from liveapp.models import Town
town_mapping = {
'town_name': 'Town_Name',
'town_type': 'Town_Type',
'geom': 'MULTIPOINT',
}
town_shp = os.path.abspath(os.path.join(os.path.dirname(__file__), 'data/subcounty', 'towns.shp'),)
def run(verbose=Tru... | 24.05 | 99 | 0.681913 | import os
from django.contrib.gis.utils import LayerMapping
from liveapp.models import Town
town_mapping = {
'town_name': 'Town_Name',
'town_type': 'Town_Type',
'geom': 'MULTIPOINT',
}
town_shp = os.path.abspath(os.path.join(os.path.dirname(__file__), 'data/subcounty', 'towns.shp'),)
def run(verbose=Tru... | true | true |
f7079f6f7700b22cd843843d2cee903b1f3ed3c2 | 295 | py | Python | straitlets/dispatch.py | quantopian/serializable-traitlets | f7de75507978e08446a15894a8417997940ea7a6 | [
"Apache-2.0"
] | 13 | 2016-01-27T01:55:18.000Z | 2022-02-10T12:09:46.000Z | straitlets/dispatch.py | quantopian/serializable-traitlets | f7de75507978e08446a15894a8417997940ea7a6 | [
"Apache-2.0"
] | 5 | 2016-02-17T13:52:50.000Z | 2018-12-13T21:30:26.000Z | straitlets/dispatch.py | quantopian/serializable-traitlets | f7de75507978e08446a15894a8417997940ea7a6 | [
"Apache-2.0"
] | 10 | 2017-07-21T14:27:17.000Z | 2022-03-16T11:19:47.000Z | """
Python <= 3.4 compat for singledispatch.
"""
from sys import version_info
if (version_info.major, version_info.minor) < (3, 4): # pragma: no cover
from singledispatch import singledispatch
else: # pragma: no cover
from functools import singledispatch
__all__ = ['singledispatch']
| 26.818182 | 73 | 0.732203 | from sys import version_info
if (version_info.major, version_info.minor) < (3, 4): from singledispatch import singledispatch
else: from functools import singledispatch
__all__ = ['singledispatch']
| true | true |
f707a04c0a3ba2c575c9cf5566717a283e97e9d4 | 5,489 | py | Python | deep_sort/sort/tracker.py | Jeasonlee313/paperdev_Phy_SORT- | 24c9ee5d3fc18ed6d3d85e4f95195d39bdf527e2 | [
"MIT"
] | null | null | null | deep_sort/sort/tracker.py | Jeasonlee313/paperdev_Phy_SORT- | 24c9ee5d3fc18ed6d3d85e4f95195d39bdf527e2 | [
"MIT"
] | null | null | null | deep_sort/sort/tracker.py | Jeasonlee313/paperdev_Phy_SORT- | 24c9ee5d3fc18ed6d3d85e4f95195d39bdf527e2 | [
"MIT"
] | null | null | null | # vim: expandtab:ts=4:sw=4
from __future__ import absolute_import
import numpy as np
from . import kalman_filter
from . import linear_assignment
from . import iou_matching
from .track import Track
class Tracker:
"""
This is the multi-target tracker.
Parameters
----------
metric : nn_matching.Near... | 38.65493 | 102 | 0.647841 | from __future__ import absolute_import
import numpy as np
from . import kalman_filter
from . import linear_assignment
from . import iou_matching
from .track import Track
class Tracker:
def __init__(self, metric, max_iou_distance=0.7, max_age=70, n_init=3, h = np.identity(3, float)):
self.metric = metric
... | true | true |
f707a053e9f789fbed38ab5f7888a21ba291fcc5 | 1,142 | py | Python | crewbank/contrib/sites/migrations/0003_set_site_domain_and_name.py | mfwarren/CrewBank | 3f66ca147aef3c589e9c99a33747f1060e4f2d48 | [
"MIT"
] | 1 | 2017-09-27T19:31:33.000Z | 2017-09-27T19:31:33.000Z | crewbank/contrib/sites/migrations/0003_set_site_domain_and_name.py | mfwarren/CrewBank | 3f66ca147aef3c589e9c99a33747f1060e4f2d48 | [
"MIT"
] | null | null | null | crewbank/contrib/sites/migrations/0003_set_site_domain_and_name.py | mfwarren/CrewBank | 3f66ca147aef3c589e9c99a33747f1060e4f2d48 | [
"MIT"
] | null | null | null | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations... | 24.297872 | 129 | 0.644483 |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
Site = apps.get_model('sites', 'Site')
Site.objects.update_or_create(
id=settings.SITE_ID,
defaults={
'domain': 'crewbank.io',
... | true | true |
f707a13f011a146ede9e74be4a032cc3cf065b90 | 1,296 | py | Python | app/core/tests/test_admin.py | anamgajith/recipe-app-api | 0624c3b5c5c3a559338af3623cf015f70f6a1ae0 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | anamgajith/recipe-app-api | 0624c3b5c5c3a559338af3623cf015f70f6a1ae0 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | anamgajith/recipe-app-api | 0624c3b5c5c3a559338af3623cf015f70f6a1ae0 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="admin@test.com",
... | 32.4 | 68 | 0.635802 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="admin@test.com",
... | true | true |
f707a156552ddcfec82940e0985328a092287f89 | 239 | py | Python | login/views.py | techonerd/Social-Connect | cde7107cbe6720291a0d47ec96f48a6619396934 | [
"Apache-2.0"
] | null | null | null | login/views.py | techonerd/Social-Connect | cde7107cbe6720291a0d47ec96f48a6619396934 | [
"Apache-2.0"
] | 1 | 2021-12-23T00:09:12.000Z | 2021-12-23T00:09:12.000Z | login/views.py | techonerd/Social-Connect | cde7107cbe6720291a0d47ec96f48a6619396934 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
def index(request):
# return HttpResponse("Hello, world. You're at the polls index.")
return render(request, 'login/index.html') | 26.555556 | 69 | 0.74477 | from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return render(request, 'login/index.html') | true | true |
f707a15fb2b735f5f3a39861cca6ed24348a8788 | 305 | py | Python | lambda_utils/response_handlers/__init__.py | Christoph-Schabert/lambda-utils | 2d9628df4e10190bb5f50b3ca3910b5d2743e060 | [
"MIT"
] | 2 | 2017-02-12T19:40:36.000Z | 2017-06-23T07:47:18.000Z | lambda_utils/response_handlers/__init__.py | Christoph-Schabert/lambda-utils | 2d9628df4e10190bb5f50b3ca3910b5d2743e060 | [
"MIT"
] | 353 | 2017-02-12T18:34:18.000Z | 2019-04-03T17:47:36.000Z | lambda_utils/response_handlers/__init__.py | Christoph-Schabert/lambda-utils | 2d9628df4e10190bb5f50b3ca3910b5d2743e060 | [
"MIT"
] | 1 | 2017-12-08T12:14:23.000Z | 2017-12-08T12:14:23.000Z | import logging
class BaseResponseHandler:
def on_execution(self, event):
logging.debug(event)
return event
def on_exception(self, ex):
logging.exception(str(ex))
raise
def on_response(self, response):
logging.debug(response)
return response
| 19.0625 | 36 | 0.642623 | import logging
class BaseResponseHandler:
def on_execution(self, event):
logging.debug(event)
return event
def on_exception(self, ex):
logging.exception(str(ex))
raise
def on_response(self, response):
logging.debug(response)
return response
| true | true |
f707a2a773eb93042cddc4014578334f97a08dbd | 4,750 | py | Python | src/rdd_bs.py | papaemman/Mining-of-Massive-Datasets-AUTh | 99a92e133bb21e4a86e9f7b3b704d258007d5f15 | [
"MIT"
] | null | null | null | src/rdd_bs.py | papaemman/Mining-of-Massive-Datasets-AUTh | 99a92e133bb21e4a86e9f7b3b704d258007d5f15 | [
"MIT"
] | null | null | null | src/rdd_bs.py | papaemman/Mining-of-Massive-Datasets-AUTh | 99a92e133bb21e4a86e9f7b3b704d258007d5f15 | [
"MIT"
] | 2 | 2021-08-31T20:29:22.000Z | 2021-10-01T10:20:16.000Z | from pyspark import SparkContext
import sys
import time
# Put node with smaller id as src of edge and node with bigger id as dst.
def reOrderingSrcAndDstOfEgde(x:list)-> tuple:
src = x[0]
dst = x[1]
probability = x[2]
if src < dst:
return (src,(dst,probability))
else:
return (dst... | 42.410714 | 172 | 0.666316 | from pyspark import SparkContext
import sys
import time
def reOrderingSrcAndDstOfEgde(x:list)-> tuple:
src = x[0]
dst = x[1]
probability = x[2]
if src < dst:
return (src,(dst,probability))
else:
return (dst,(src,probability))
def findEdgesToSearchToCalculateAllTriangles(node:str,... | true | true |
f707a2cda281657a347a6780a6cd2b1bcc1cb279 | 1,786 | py | Python | venv/lib/python3.6/site-packages/wtforms/ext/csrf/form.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/wtforms/ext/csrf/form.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | venv/lib/python3.6/site-packages/wtforms/ext/csrf/form.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from wtforms.form import Form
from wtforms.validators import ValidationError
from .fields import CSRFTokenField
class SecureForm(Form):
"""
Form that enables CSRF processing via subclassing hooks.
"""
csrf_token = CSRFTokenField()
def __init__(self, form... | 32.472727 | 88 | 0.666853 | from __future__ import unicode_literals
from wtforms.form import Form
from wtforms.validators import ValidationError
from .fields import CSRFTokenField
class SecureForm(Form):
csrf_token = CSRFTokenField()
def __init__(self, formdata=None, obj=None, prefix="", csrf_context=None, **kwargs):
super(S... | true | true |
f707a2f41d8e690e8b8403065e8ca856caf1f920 | 8,370 | py | Python | meta_logger.py | moojink/drq | e05c337aeb6fcae30c2db6e4afaca65e94511bbd | [
"MIT"
] | null | null | null | meta_logger.py | moojink/drq | e05c337aeb6fcae30c2db6e4afaca65e94511bbd | [
"MIT"
] | null | null | null | meta_logger.py | moojink/drq | e05c337aeb6fcae30c2db6e4afaca65e94511bbd | [
"MIT"
] | null | null | null | import csv
import json
import os
import shutil
from collections import defaultdict
import numpy as np
import torch
import torchvision
from termcolor import colored
from torch.utils.tensorboard import SummaryWriter
COMMON_TRAIN_FORMAT = [('episode', 'E', 'int'), ('step', 'S', 'int'),
('episode_... | 36.391304 | 79 | 0.573357 | import csv
import json
import os
import shutil
from collections import defaultdict
import numpy as np
import torch
import torchvision
from termcolor import colored
from torch.utils.tensorboard import SummaryWriter
COMMON_TRAIN_FORMAT = [('episode', 'E', 'int'), ('step', 'S', 'int'),
('episode_... | true | true |
f707a320d1b7f1b8921866d733f39050efc7578b | 750 | py | Python | python/binary_tree/level_order.py | amitsaha/playground | 82cb5ac02ac90d3fa858a5153b0a5705187c14ce | [
"Unlicense"
] | 4 | 2018-04-14T16:28:39.000Z | 2021-11-14T12:08:02.000Z | python/binary_tree/level_order.py | amitsaha/playground | 82cb5ac02ac90d3fa858a5153b0a5705187c14ce | [
"Unlicense"
] | 3 | 2022-02-14T10:38:51.000Z | 2022-02-27T16:01:16.000Z | python/binary_tree/level_order.py | amitsaha/playground | 82cb5ac02ac90d3fa858a5153b0a5705187c14ce | [
"Unlicense"
] | 4 | 2015-07-07T01:01:27.000Z | 2019-04-12T05:38:26.000Z | '''
Level order binary tree traversal
'''
from collections import deque
class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
n1 = Node(1)
n2 = Node(2)
n3 = Node(3)
n4 = Node(None)
n5 = Node(2)
n6 = Node(None)
n7 = Node(3)
'''
1
... | 15 | 47 | 0.566667 | '''
Level order binary tree traversal
'''
from collections import deque
class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
n1 = Node(1)
n2 = Node(2)
n3 = Node(3)
n4 = Node(None)
n5 = Node(2)
n6 = Node(None)
n7 = Node(3)
'''
1
... | false | true |
f707a3492c750af198258b9f0c53a07e78fef229 | 7,298 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/locations/ports/ports.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/locations/ports/ports.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | uhd_restpy/testplatform/sessions/ixnetwork/locations/ports/ports.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 43.700599 | 1,073 | 0.699644 | from uhd_restpy.base import Base
from uhd_restpy.files import Files
class Ports(Base):
__slots__ = ()
_SDM_NAME = 'ports'
_SDM_ATT_MAP = {
'Description': 'description',
'IsAvailable': 'isAvailable',
'IsBusy': 'isBusy',
'IsLinkUp': 'isLinkUp',
'Location': 'location'... | true | true |
f707a3f06a7cb5465d7d05ec43434eb468d41d63 | 153,194 | py | Python | from_3b1b/old/uncertainty.py | adornetejr/manim | e0715ceeff4778d11ef4ac31f8f8f2b56a2187ad | [
"MIT"
] | 48 | 2021-06-28T01:48:01.000Z | 2022-03-31T18:22:32.000Z | from_3b1b/old/uncertainty.py | im-AMS/manim | 19e3c97589181ffd43ef14d9169af4e40e054664 | [
"MIT"
] | 5 | 2021-03-19T11:41:36.000Z | 2022-03-12T00:20:16.000Z | from_3b1b/old/uncertainty.py | im-AMS/manim | 19e3c97589181ffd43ef14d9169af4e40e054664 | [
"MIT"
] | 15 | 2021-06-28T07:48:36.000Z | 2022-03-23T03:05:11.000Z | # -*- coding: utf-8 -*-
import scipy
from manimlib.imports import *
from from_3b1b.old.fourier import *
import warnings
warnings.warn("""
Warning: This file makes use of
ContinualAnimation, which has since
been deprecated
""")
FREQUENCY_COLOR = RED
USE_ALMOST_FOURIER_BY_DEFAULT = False
class GaussianDis... | 32.319409 | 95 | 0.555994 |
import scipy
from manimlib.imports import *
from from_3b1b.old.fourier import *
import warnings
warnings.warn("""
Warning: This file makes use of
ContinualAnimation, which has since
been deprecated
""")
FREQUENCY_COLOR = RED
USE_ALMOST_FOURIER_BY_DEFAULT = False
class GaussianDistributionWrapper(Line):
... | true | true |
f707a4256c7b6a07fa804637aec60c40fb024bfa | 383 | py | Python | server/api/migrations/0005_auto_20180128_1006.py | MePsyDuck/OAPS | ddbc69fbd11d1a02d37514d48f5dabe04cd23405 | [
"MIT"
] | null | null | null | server/api/migrations/0005_auto_20180128_1006.py | MePsyDuck/OAPS | ddbc69fbd11d1a02d37514d48f5dabe04cd23405 | [
"MIT"
] | null | null | null | server/api/migrations/0005_auto_20180128_1006.py | MePsyDuck/OAPS | ddbc69fbd11d1a02d37514d48f5dabe04cd23405 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-01-28 04:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20180128_1003'),
]
operations = [
migrations.AlterField(
model_name='letter',
name='subject',
... | 21.277778 | 51 | 0.597911 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_auto_20180128_1003'),
]
operations = [
migrations.AlterField(
model_name='letter',
name='subject',
field=models.CharField(max_length=100),
... | true | true |
f707a43cd6ba940c14e9a07639e1578abc670941 | 2,622 | py | Python | Data_analysis/SNP-indel-calling/dadi/dadiExercises/examples/YRI_CEU/demographic_models.py | claudiuskerth/PhDthesis | 66cb32c9bc481af8f80cd971e35cdc56717a60de | [
"MIT"
] | null | null | null | Data_analysis/SNP-indel-calling/dadi/dadiExercises/examples/YRI_CEU/demographic_models.py | claudiuskerth/PhDthesis | 66cb32c9bc481af8f80cd971e35cdc56717a60de | [
"MIT"
] | null | null | null | Data_analysis/SNP-indel-calling/dadi/dadiExercises/examples/YRI_CEU/demographic_models.py | claudiuskerth/PhDthesis | 66cb32c9bc481af8f80cd971e35cdc56717a60de | [
"MIT"
] | null | null | null | """
Custom demographic model for our example.
"""
import numpy
import dadi
def prior_onegrow_mig((nu1F, nu2B, nu2F, m, Tp, T), (n1,n2), pts):
"""
Model with growth, split, bottleneck in pop2, exp recovery, migration
nu1F: The ancestral population size after growth. (Its initial size is
defined t... | 34.051948 | 76 | 0.632342 | """
Custom demographic model for our example.
"""
import numpy
import dadi
def prior_onegrow_mig((nu1F, nu2B, nu2F, m, Tp, T), (n1,n2), pts):
"""
Model with growth, split, bottleneck in pop2, exp recovery, migration
nu1F: The ancestral population size after growth. (Its initial size is
defined t... | false | true |
f707a45e451d301022f927dfec70269a0d257c04 | 5,578 | py | Python | test/test_selection.py | arpruss/pygame-menu | 25cefb5cfc60383544d704b83a32d43dfc621c23 | [
"MIT"
] | null | null | null | test/test_selection.py | arpruss/pygame-menu | 25cefb5cfc60383544d704b83a32d43dfc621c23 | [
"MIT"
] | null | null | null | test/test_selection.py | arpruss/pygame-menu | 25cefb5cfc60383544d704b83a32d43dfc621c23 | [
"MIT"
] | null | null | null | """
pygame-menu
https://github.com/ppizarror/pygame-menu
TEST WIDGET SELECTION.
Test widget selection effects.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2021 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of charge, t... | 33.401198 | 84 | 0.644676 |
__all__ = ['SelectionTest']
from test._utils import MenuUtils, surface
import copy
import unittest
from pygame_menu.widgets import Button
from pygame_menu.widgets.selection import LeftArrowSelection, RightArrowSelection, \
HighlightSelection, NoneSelection, SimpleSelection
from pygame_menu.widgets.core.selectio... | true | true |
f707a49d416f27b0ecff72b18c4680093e2c3895 | 206 | py | Python | Armstrong.py | arelemegha/python-programs | c9af116c0db45dcd13d97e80a32733df372fe2d4 | [
"CC0-1.0"
] | null | null | null | Armstrong.py | arelemegha/python-programs | c9af116c0db45dcd13d97e80a32733df372fe2d4 | [
"CC0-1.0"
] | null | null | null | Armstrong.py | arelemegha/python-programs | c9af116c0db45dcd13d97e80a32733df372fe2d4 | [
"CC0-1.0"
] | null | null | null | n = int(input("Enter a number : "))
s = 0
num =n
while(n>0):
r = n % 10
s = s + r* r* r
n = n//10
if(s==num):
print("The number is Armstrong")
else:
print("The number is not Armstrong")
| 17.166667 | 40 | 0.533981 | n = int(input("Enter a number : "))
s = 0
num =n
while(n>0):
r = n % 10
s = s + r* r* r
n = n//10
if(s==num):
print("The number is Armstrong")
else:
print("The number is not Armstrong")
| true | true |
f707a510b34db8fde66e998d0f2a436c86b0c354 | 33 | py | Python | requirements.txt.py | mizamae/DIY4dot0 | 2ca594ffcdb8b26da1e0ac7ed9984df64a97db58 | [
"MIT"
] | null | null | null | requirements.txt.py | mizamae/DIY4dot0 | 2ca594ffcdb8b26da1e0ac7ed9984df64a97db58 | [
"MIT"
] | 9 | 2017-11-21T15:45:18.000Z | 2022-02-11T03:37:54.000Z | requirements.txt.py | mizamae/DIY4dot0 | 2ca594ffcdb8b26da1e0ac7ed9984df64a97db58 | [
"MIT"
] | 1 | 2020-07-22T02:24:17.000Z | 2020-07-22T02:24:17.000Z | XX XXXXXXXXXXXXXXXXXXXXXXXXXXXX
| 16.5 | 32 | 0.909091 | XX XXXXXXXXXXXXXXXXXXXXXXXXXXXX
| false | true |
f707a737e553def25058f11a5331e623cb147c67 | 406 | py | Python | websites/migrations/0017_rename_filepath.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | 2 | 2020-08-07T15:55:41.000Z | 2021-08-16T18:28:09.000Z | websites/migrations/0017_rename_filepath.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | 924 | 2020-08-10T17:54:19.000Z | 2022-03-31T21:15:17.000Z | websites/migrations/0017_rename_filepath.py | mitodl/ocw-studio | 949f96ec0647064f8d495ebdd22d66eea7d024a5 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.6 on 2021-04-14 15:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("websites", "0016_remove_site_content_type_constraint"),
]
operations = [
migrations.RenameField(
model_name="websitecontent",
... | 21.368421 | 65 | 0.628079 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("websites", "0016_remove_site_content_type_constraint"),
]
operations = [
migrations.RenameField(
model_name="websitecontent",
old_name="hugo_filepath",
new_name... | true | true |
f707a7429d8663d95daeaa86cc6106e5370fc538 | 334 | py | Python | toolkit/visualization/draw_utils.py | airium/pysot | c34158ba7b4a9b73938320e0019b61e6460537fc | [
"Apache-2.0"
] | null | null | null | toolkit/visualization/draw_utils.py | airium/pysot | c34158ba7b4a9b73938320e0019b61e6460537fc | [
"Apache-2.0"
] | null | null | null | toolkit/visualization/draw_utils.py | airium/pysot | c34158ba7b4a9b73938320e0019b61e6460537fc | [
"Apache-2.0"
] | null | null | null | COLOR = ((1, 0, 0), (0, 1, 0), (1, 0, 1), (1, 1, 0), (0, 162 / 255, 232 / 255), (0.5, 0.5, 0.5), (0, 0, 1), (0, 1, 1),
(136 / 255, 0, 21 / 255), (255 / 255, 127 / 255, 39 / 255), (0, 0, 0))
LINE_STYLE = ['-', '--', ':', '-', '--', ':', '-', '--', ':', '-']
MARKER_STYLE = ['o', 'v', '<', '*', 'D', 'x', '.', '... | 47.714286 | 118 | 0.302395 | COLOR = ((1, 0, 0), (0, 1, 0), (1, 0, 1), (1, 1, 0), (0, 162 / 255, 232 / 255), (0.5, 0.5, 0.5), (0, 0, 1), (0, 1, 1),
(136 / 255, 0, 21 / 255), (255 / 255, 127 / 255, 39 / 255), (0, 0, 0))
LINE_STYLE = ['-', '--', ':', '-', '--', ':', '-', '--', ':', '-']
MARKER_STYLE = ['o', 'v', '<', '*', 'D', 'x', '.', '... | true | true |
f707a796c39cbd67c8af787b6b9a266f5e4f040b | 2,578 | py | Python | tests/test_validator_create.py | VariantEffect/fqfa | f99e96009a05a24ca6aabbf9e04d3cf87fe00cb4 | [
"BSD-3-Clause"
] | 2 | 2019-12-24T06:53:57.000Z | 2020-01-15T21:06:24.000Z | tests/test_validator_create.py | VariantEffect/fqfa | f99e96009a05a24ca6aabbf9e04d3cf87fe00cb4 | [
"BSD-3-Clause"
] | 3 | 2020-01-23T03:34:47.000Z | 2020-02-20T10:22:23.000Z | tests/test_validator_create.py | VariantEffect/fqfa | f99e96009a05a24ca6aabbf9e04d3cf87fe00cb4 | [
"BSD-3-Clause"
] | 2 | 2020-02-11T23:39:11.000Z | 2020-03-28T22:00:24.000Z | import unittest
from fqfa.validator.create import create_validator
class TestCreateValidator(unittest.TestCase):
def test_create_from_string(self) -> None:
# case sensitive
validator = create_validator("ACGT")
# test valid strings
self.assertIsNotNone(validator("ACGT"))
s... | 33.051282 | 80 | 0.640419 | import unittest
from fqfa.validator.create import create_validator
class TestCreateValidator(unittest.TestCase):
def test_create_from_string(self) -> None:
validator = create_validator("ACGT")
self.assertIsNotNone(validator("ACGT"))
self.assertIsNotNone(validator("AAAAAAA... | true | true |
f707a803b8253bc035a491d4c9d83e52765edaa4 | 1,204 | py | Python | rpip/tests/test_output.py | danielfrg/remote-pip | 1635388edb9215c811ab7632769a2b56f464c55b | [
"Apache-2.0"
] | 5 | 2015-10-28T06:30:55.000Z | 2022-03-09T07:05:26.000Z | rpip/tests/test_output.py | danielfrg/remote-pip | 1635388edb9215c811ab7632769a2b56f464c55b | [
"Apache-2.0"
] | null | null | null | rpip/tests/test_output.py | danielfrg/remote-pip | 1635388edb9215c811ab7632769a2b56f464c55b | [
"Apache-2.0"
] | 1 | 2019-11-02T16:39:32.000Z | 2019-11-02T16:39:32.000Z | from rpip.output import Output
exit0 = {'exit_code': 0, 'stdout': 'yes', 'stderr': ''}
exit1 = {'exit_code': 1, 'stdout': '', 'stderr': 'ERROR'}
o0 = {'host1': exit0, 'host2': exit0, 'host3': exit0}
o1 = {'host1': exit0, 'host2': exit1, 'host3': exit0}
o2 = {'host1': exit0, 'host2': exit1, 'host3': exit1}
def test_... | 23.153846 | 57 | 0.579734 | from rpip.output import Output
exit0 = {'exit_code': 0, 'stdout': 'yes', 'stderr': ''}
exit1 = {'exit_code': 1, 'stdout': '', 'stderr': 'ERROR'}
o0 = {'host1': exit0, 'host2': exit0, 'host3': exit0}
o1 = {'host1': exit0, 'host2': exit1, 'host3': exit0}
o2 = {'host1': exit0, 'host2': exit1, 'host3': exit1}
def test_... | true | true |
f707a8765e9180ae397c0300f2561d2885361426 | 37,219 | py | Python | empire/server/data/agent/agent.py | joewildiml/Empire | d60f36d10c674b51dd60f63efe3b1ae007d5933e | [
"BSD-3-Clause"
] | 1 | 2022-02-03T20:01:56.000Z | 2022-02-03T20:01:56.000Z | empire/server/data/agent/agent.py | joewildiml/Empire | d60f36d10c674b51dd60f63efe3b1ae007d5933e | [
"BSD-3-Clause"
] | null | null | null | empire/server/data/agent/agent.py | joewildiml/Empire | d60f36d10c674b51dd60f63efe3b1ae007d5933e | [
"BSD-3-Clause"
] | null | null | null | import json
import struct
import base64
import subprocess
import random
import time
import datetime
import os
import sys
import zlib
import threading
import http.server
import zipfile
import io
import types
import re
import shutil
import pwd
import socket
import math
import stat
import grp
import numbers
from os.path i... | 33.6215 | 151 | 0.563422 | import json
import struct
import base64
import subprocess
import random
import time
import datetime
import os
import sys
import zlib
import threading
import http.server
import zipfile
import io
import types
import re
import shutil
import pwd
import socket
import math
import stat
import grp
import numbers
from os.path i... | true | true |
f707a8a672d292d42d116e94949be97179511008 | 4,052 | py | Python | setup.py | RogelioJCDiaz/AMPLpy | 739c05cd399326f06711a089664d83ec08ccf1c0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | RogelioJCDiaz/AMPLpy | 739c05cd399326f06711a089664d83ec08ccf1c0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | RogelioJCDiaz/AMPLpy | 739c05cd399326f06711a089664d83ec08ccf1c0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
AMPLPY
------
AMPL API is an interface that allows developers to access the features of the
AMPL interpreter from within a programming language. All model generation and
solver interaction is handled directly by AMPL, which leads to great stability
and speed; the library just acts as an int... | 32.416 | 78 | 0.641412 | from setuptools import setup, Extension
import platform
import os
OSTYPE = platform.system()
x64 = platform.architecture()[0] == '64bit'
def ls_dir(base_dir):
return [
os.path.join(dirpath.replace(base_dir, '', 1), f)
for (dirpath, dirnames, files) in os.walk(base_dir)
for f in files
... | true | true |
f707a9d2fe766b271f48e947fb3a4150371a8854 | 7,427 | py | Python | BatchLabelMap/automatic/pydicom/benchmarks/bench_handler_numpy.py | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | null | null | null | BatchLabelMap/automatic/pydicom/benchmarks/bench_handler_numpy.py | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | 1 | 2020-11-26T19:53:16.000Z | 2020-11-26T19:53:16.000Z | BatchLabelMap/automatic/pydicom/benchmarks/bench_handler_numpy.py | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | null | null | null | # Copyright 2008-2018 pydicom authors. See LICENSE file for details.
"""Benchmarks for the numpy_handler module.
Requires asv and numpy.
"""
from platform import python_implementation
from tempfile import TemporaryFile
import numpy as np
from pydicom import dcmread
from pydicom.data import get_testdata_file
from py... | 34.544186 | 77 | 0.67497 |
from platform import python_implementation
from tempfile import TemporaryFile
import numpy as np
from pydicom import dcmread
from pydicom.data import get_testdata_file
from pydicom.dataset import Dataset, FileMetaDataset
from pydicom.pixel_data_handlers.numpy_handler import get_pixeldata
from pydicom.uid import Expl... | true | true |
f707aa0c7923a796e3b67abb787f185ffce6b4be | 881 | py | Python | web/app/app.py | RyanSept/docker-compose-flask | daf7a6d930392053713f1ed053b8729c9406e7b9 | [
"Apache-2.0"
] | null | null | null | web/app/app.py | RyanSept/docker-compose-flask | daf7a6d930392053713f1ed053b8729c9406e7b9 | [
"Apache-2.0"
] | null | null | null | web/app/app.py | RyanSept/docker-compose-flask | daf7a6d930392053713f1ed053b8729c9406e7b9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 31.464286 | 85 | 0.716232 |
import os
import socket
from flask import Flask, request
app = Flask(__name__)
@app.route("/", methods=["GET", "POST"])
def hello():
print request.data
return "Hello Container World! My hostname is {}.\n".format(socket.gethostname())
| false | true |
f707aa7a0696a54e914ac4997aacd7f015e19161 | 279 | py | Python | tests/artificial/transf_RelativeDifference/trend_Lag1Trend/cycle_12/ar_12/test_artificial_128_RelativeDifference_Lag1Trend_12_12_0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/artificial/transf_RelativeDifference/trend_Lag1Trend/cycle_12/ar_12/test_artificial_128_RelativeDifference_Lag1Trend_12_12_0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/artificial/transf_RelativeDifference/trend_Lag1Trend/cycle_12/ar_12/test_artificial_128_RelativeDifference_Lag1Trend_12_12_0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 12, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12); | 39.857143 | 174 | 0.741935 | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 12, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12); | true | true |
f707ab8c58c89f5eab4c2f3f9d38c22b4c2ce795 | 167 | py | Python | test_whats.py | shispt/whats | f1b266432bf90723e30afdad4d5df7b6e26beade | [
"MIT"
] | 3 | 2017-06-09T19:00:19.000Z | 2017-06-13T01:24:32.000Z | test_whats.py | shispt/whats | f1b266432bf90723e30afdad4d5df7b6e26beade | [
"MIT"
] | 3 | 2017-06-08T02:21:07.000Z | 2017-06-19T16:46:00.000Z | test_whats.py | shispt/whats | f1b266432bf90723e30afdad4d5df7b6e26beade | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from whats import whats
def test_tellme():
assert whats.tellme('美妙的新世界')
| 15.181818 | 39 | 0.706587 |
from __future__ import unicode_literals
from whats import whats
def test_tellme():
assert whats.tellme('美妙的新世界')
| true | true |
f707ac7a357deba1360d4b63d98ae3014f9e3825 | 3,393 | py | Python | tests/test_data.py | kuanhc96/decanter-ai-core-sdk | 74300f56b690feac1737c89a0630582ba5daa1fd | [
"MIT"
] | 3 | 2021-01-20T08:54:27.000Z | 2021-07-13T08:53:38.000Z | tests/test_data.py | kuanhc96/decanter-ai-core-sdk | 74300f56b690feac1737c89a0630582ba5daa1fd | [
"MIT"
] | 5 | 2020-08-14T17:49:25.000Z | 2021-07-15T06:25:04.000Z | tests/test_data.py | kuanhc96/decanter-ai-core-sdk | 74300f56b690feac1737c89a0630582ba5daa1fd | [
"MIT"
] | 4 | 2020-08-14T07:24:19.000Z | 2021-10-06T05:21:00.000Z | # pylint: disable=redefined-builtin
# pylint: disable=too-many-arguments
"""Test related method and functionality of Context."""
import pytest
import responses
from decanter.core import Context
from decanter.core.core_api import TrainInput
from decanter.core.extra import CoreStatus
from decanter.core.jobs import DataU... | 35.715789 | 93 | 0.703212 | import pytest
import responses
from decanter.core import Context
from decanter.core.core_api import TrainInput
from decanter.core.extra import CoreStatus
from decanter.core.jobs import DataUpload
fail_conds = [(stat, res) for stat in CoreStatus.FAIL_STATUS for res in [None, 'result']]
fail_conds.append((CoreStatus.DO... | true | true |
f707ad48d655f5a1de6caf6b6c93f8f68adf554c | 59,087 | py | Python | hikari/impl/bot.py | CircuitSacul/hikari | 67671075dbe45095ac56c66ee5a5859d0e124df8 | [
"MIT"
] | null | null | null | hikari/impl/bot.py | CircuitSacul/hikari | 67671075dbe45095ac56c66ee5a5859d0e124df8 | [
"MIT"
] | null | null | null | hikari/impl/bot.py | CircuitSacul/hikari | 67671075dbe45095ac56c66ee5a5859d0e124df8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# cython: language_level=3
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, inc... | 42.539237 | 120 | 0.639413 |
from __future__ import annotations
__all__: typing.List[str] = ["GatewayBot"]
import asyncio
import datetime
import logging
import math
import signal
import sys
import threading
import traceback
import types
import typing
import warnings
from hikari import applications
from hikari import errors
from hikari import i... | true | true |
f707ae782f2ab37d3669980273f149ae70d29ab3 | 880 | py | Python | pipeline_plugins/apps.py | mmqzlj/bk-sops | eb1292d0d949197c4b3b69357b7d817f459dc7ac | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | pipeline_plugins/apps.py | mmqzlj/bk-sops | eb1292d0d949197c4b3b69357b7d817f459dc7ac | [
"Apache-2.0"
] | 5 | 2020-02-12T02:55:56.000Z | 2021-06-10T22:57:10.000Z | pipeline_plugins/apps.py | mmqzlj/bk-sops | eb1292d0d949197c4b3b69357b7d817f459dc7ac | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 41.904762 | 115 | 0.792045 |
from __future__ import unicode_literals
from django.apps import AppConfig
class PipelinePluginsConfig(AppConfig):
name = 'pipeline_plugins'
| true | true |
f707b2d689b6899a968f7f569001203c9440ef3b | 73 | py | Python | log.py | Windfisch/agario-frickel | 04acf7e45d08878733b0d0a0d65f319f6d14d224 | [
"BSD-3-Clause"
] | 2 | 2015-08-11T00:47:49.000Z | 2016-03-05T13:09:12.000Z | log.py | Windfisch/agario-frickel | 04acf7e45d08878733b0d0a0d65f319f6d14d224 | [
"BSD-3-Clause"
] | 23 | 2015-08-10T11:11:05.000Z | 2015-09-22T16:18:04.000Z | log.py | Windfisch/agario-frickel | 04acf7e45d08878733b0d0a0d65f319f6d14d224 | [
"BSD-3-Clause"
] | null | null | null | logging = False
def log(string):
if logging:
print(string)
| 10.428571 | 21 | 0.60274 | logging = False
def log(string):
if logging:
print(string)
| true | true |
f707b33898280eaac5416d3b674ceab08848bef6 | 579 | py | Python | consulate/api/__init__.py | python-microservices/consulate | 9d95a946b3a5c3095437801488cf84836d72192c | [
"BSD-3-Clause"
] | null | null | null | consulate/api/__init__.py | python-microservices/consulate | 9d95a946b3a5c3095437801488cf84836d72192c | [
"BSD-3-Clause"
] | null | null | null | consulate/api/__init__.py | python-microservices/consulate | 9d95a946b3a5c3095437801488cf84836d72192c | [
"BSD-3-Clause"
] | null | null | null | """
Consul API Endpoints
"""
from consulate.api.acl import ACL
from consulate.api.agent import Agent
from consulate.api.base import Response
from consulate.api.catalog import Catalog
from consulate.api.coordinate import Coordinate
from consulate.api.event import Event
from consulate.api.health import Health
from consu... | 32.166667 | 117 | 0.780656 | from consulate.api.acl import ACL
from consulate.api.agent import Agent
from consulate.api.base import Response
from consulate.api.catalog import Catalog
from consulate.api.coordinate import Coordinate
from consulate.api.event import Event
from consulate.api.health import Health
from consulate.api.kv import KV
from con... | true | true |
f707b416f6ad86fb6c6a69d25bcc72f5f4890c66 | 14,050 | py | Python | src/logplot/logging_plotting.py | G-Thor/merlin | 33fa6e65ddb903ed5633ccb66c74d3e7c128667f | [
"Apache-2.0"
] | 1,305 | 2016-08-10T17:32:36.000Z | 2022-03-29T08:23:34.000Z | src/logplot/logging_plotting.py | G-Thor/merlin | 33fa6e65ddb903ed5633ccb66c74d3e7c128667f | [
"Apache-2.0"
] | 464 | 2016-08-15T16:09:12.000Z | 2022-01-04T01:26:57.000Z | src/logplot/logging_plotting.py | G-Thor/merlin | 33fa6e65ddb903ed5633ccb66c74d3e7c128667f | [
"Apache-2.0"
] | 508 | 2016-08-10T16:58:23.000Z | 2022-03-23T06:52:06.000Z | ################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# University of Edinburgh, UK
# ... | 37.87062 | 141 | 0.653737 | # from this software without specific prior written permission.
#
# THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK
# DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT
# SHALL THE UNIVERSITY OF EDINBURGH NOR THE CON... | true | true |
f707b500c5ee72beaed596d031c6f55b8804b116 | 13,617 | py | Python | intermediate_source/model_parallel_tutorial.py | Mirwaisse/tutorials | c1523d3f16d6a4bd370261129c75a4383c5491d9 | [
"BSD-3-Clause"
] | 1 | 2022-02-23T03:13:50.000Z | 2022-02-23T03:13:50.000Z | intermediate_source/model_parallel_tutorial.py | MaureenZOU/tutorials | 18ec63ce8c85ef11af92685cc1436fd3034efc74 | [
"BSD-3-Clause"
] | 2 | 2022-01-13T04:11:34.000Z | 2022-03-12T01:04:00.000Z | intermediate_source/model_parallel_tutorial.py | MaureenZOU/tutorials | 18ec63ce8c85ef11af92685cc1436fd3034efc74 | [
"BSD-3-Clause"
] | 2 | 2020-02-22T21:33:40.000Z | 2021-08-19T02:06:56.000Z | # -*- coding: utf-8 -*-
"""
Model Parallel Best Practices
*************************************************************
**Author**: `Shen Li <https://mrshenli.github.io/>`_
Data parallel and model parallel are widely-used in distributed training
techniques. Previous posts have explained how to use
`DataParallel <https... | 39.469565 | 90 | 0.674598 |
import torch
import torch.nn as nn
import torch.optim as optim
class ToyModel(nn.Module):
def __init__(self):
super(ToyModel, self).__init__()
self.net1 = torch.nn.Linear(10, 10).to('cuda:0')
self.relu = torch.nn.ReLU()
self.net2 = torch.nn.Linear(10, 5).to('cuda:1')
def for... | true | true |
f707b572ae1a2c834e8c3449601082540bbbbc5c | 799 | py | Python | celery_app.py | smileboywtu/fastapi-boilerplate | 0123b621dca546d80a9811dfcc755657058ca795 | [
"MIT"
] | 22 | 2020-03-07T08:38:48.000Z | 2022-01-14T15:59:42.000Z | celery_app.py | smileboywtu/fastapi-boilerplate | 0123b621dca546d80a9811dfcc755657058ca795 | [
"MIT"
] | 1 | 2020-09-08T03:24:28.000Z | 2020-09-08T03:24:28.000Z | celery_app.py | smileboywtu/fastapi-boilerplate | 0123b621dca546d80a9811dfcc755657058ca795 | [
"MIT"
] | 2 | 2021-12-27T14:28:36.000Z | 2022-01-29T19:13:37.000Z | # -*- coding: utf-8 -*-
from celery import Celery
import config
if config.REDIS_PASSWD:
redis_url = "redis://:{0}@{1}:{2}/{3}".format(
config.REDIS_PASSWD,
config.REDIS_HOST,
config.REDIS_PORT,
config.REDIS_DB
)
else:
redis_url = "redis://{0}:{1}/{2}".format(
config... | 18.581395 | 50 | 0.607009 | from celery import Celery
import config
if config.REDIS_PASSWD:
redis_url = "redis://:{0}@{1}:{2}/{3}".format(
config.REDIS_PASSWD,
config.REDIS_HOST,
config.REDIS_PORT,
config.REDIS_DB
)
else:
redis_url = "redis://{0}:{1}/{2}".format(
config.REDIS_HOST,
con... | true | true |
f707b5ac5257edd2223a3f5854acf58bcac157b9 | 10,501 | py | Python | official/recommendation/ncf_test.py | kichiro09/object-detection | b7087955bb5f2689b0ef42ab5400931cd8f416b6 | [
"Apache-2.0"
] | 48 | 2018-12-19T13:09:14.000Z | 2021-11-12T12:04:36.000Z | official/recommendation/ncf_test.py | bhushan23/models | e498d28503fd4a12d1fa9ade41891f2f9601c674 | [
"Apache-2.0"
] | 12 | 2018-12-13T18:04:36.000Z | 2019-06-14T20:49:33.000Z | official/recommendation/ncf_test.py | bhushan23/models | e498d28503fd4a12d1fa9ade41891f2f9601c674 | [
"Apache-2.0"
] | 44 | 2018-11-09T21:04:52.000Z | 2019-06-24T07:40:28.000Z | # Copyright 2018 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... | 38.185455 | 80 | 0.614227 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import mock
import numpy as np
import tensorflow as tf
from absl import flags
from absl.testing import flagsaver
from official.recommendation import constants as rconst
from official.recommendati... | true | true |
f707b6735f008d7dd90e517844d0d8cbdb9bb221 | 830 | py | Python | scripts/advanced_collectible/deploy_advanced.py | glogwa68/Gojicoin | 8f65f7091f965e63b62f72347d8cf3d5c79f36ab | [
"MIT"
] | 2 | 2021-04-22T16:16:46.000Z | 2021-04-24T07:48:11.000Z | scripts/advanced_collectible/deploy_advanced.py | toiaa/nft-mix | c73d1f2612440490c33b04c8cbac0eb9a086c514 | [
"MIT"
] | null | null | null | scripts/advanced_collectible/deploy_advanced.py | toiaa/nft-mix | c73d1f2612440490c33b04c8cbac0eb9a086c514 | [
"MIT"
] | 1 | 2021-07-14T17:18:37.000Z | 2021-07-14T17:18:37.000Z | #!/usr/bin/python3
from brownie import AdvancedCollectible, accounts, network, config
from scripts.helpful_scripts import fund_advanced_collectible
def main():
print(config["wallets"]["from_key"])
dev = accounts.add(config["wallets"]["from_key"])
print(network.show_active())
# publish_source = True if... | 39.52381 | 108 | 0.720482 | from brownie import AdvancedCollectible, accounts, network, config
from scripts.helpful_scripts import fund_advanced_collectible
def main():
print(config["wallets"]["from_key"])
dev = accounts.add(config["wallets"]["from_key"])
print(network.show_active())
publish_source = False
advanced_colle... | true | true |
f707b8955010ddb9ca4a46873c7c4a917555830a | 2,329 | py | Python | examples/twisted/websocket/echo_service/echows/main.py | dimddev/AutobahnPython | 75442d2d1d2d2a3248ca264e3d196db5fbad0f70 | [
"MIT"
] | null | null | null | examples/twisted/websocket/echo_service/echows/main.py | dimddev/AutobahnPython | 75442d2d1d2d2a3248ca264e3d196db5fbad0f70 | [
"MIT"
] | null | null | null | examples/twisted/websocket/echo_service/echows/main.py | dimddev/AutobahnPython | 75442d2d1d2d2a3248ca264e3d196db5fbad0f70 | [
"MIT"
] | null | null | null | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software with... | 34.761194 | 104 | 0.681838 |
import twisted
from twisted.python import log, usage
from twisted.application.service import MultiService
from echoservice import EchoService
class AppService(MultiService):
def startService(self):
svc = EchoService(self.port, self.debug)
svc.setName("EchoService")
svc.setServ... | true | true |
f707b8d2ea591e22da57beaa84d6d6571d614fea | 27,318 | py | Python | scripts/testing/verify_data.py | ROSMilitary/DDR_Data_Recorder | d491a8433f2e3ae1ed88eea5c6f13207ab55247f | [
"MIT"
] | 5 | 2020-10-21T18:06:33.000Z | 2022-02-04T21:01:24.000Z | scripts/testing/verify_data.py | ROSMilitary/DDR_Data_Recorder | d491a8433f2e3ae1ed88eea5c6f13207ab55247f | [
"MIT"
] | null | null | null | scripts/testing/verify_data.py | ROSMilitary/DDR_Data_Recorder | d491a8433f2e3ae1ed88eea5c6f13207ab55247f | [
"MIT"
] | 4 | 2021-03-27T00:33:11.000Z | 2022-02-04T21:01:14.000Z | #!/usr/bin/env python3
#******************************************************************************
#
#"Distribution A: Approved for public release; distribution unlimited. OPSEC #4046"
#
#PROJECT: DDR
#
# PACKAGE :
# ORIGINAL AUTHOR :
# MODIFIED DATE :
# MODIFIED BY :
# REVISION :
#
# Copyrigh... | 36.278884 | 104 | 0.646167 |
import argparse
import collections
import glob
import logging
import logging.handlers
import mmap
import os
import pprint
import re
import sys
import threading
import rosbag
import rospkg
from topic_bag_checker import TopicBagChecker
from topic_connection import TopicConnection
from verification_report import Verif... | true | true |
f707b9a52128990810436baec085b0207d9a58e1 | 8,369 | py | Python | tests/testing/test_utils.py | KarrLab/wc_sim | 5b0ee03c3d19193fa67a3797d4258b753e6bc576 | [
"MIT"
] | 8 | 2018-03-27T21:35:25.000Z | 2022-01-18T08:32:20.000Z | tests/testing/test_utils.py | KarrLab/wc_sim | 5b0ee03c3d19193fa67a3797d4258b753e6bc576 | [
"MIT"
] | 114 | 2018-02-27T14:14:39.000Z | 2020-12-30T15:06:51.000Z | tests/testing/test_utils.py | KarrLab/wc_sim | 5b0ee03c3d19193fa67a3797d4258b753e6bc576 | [
"MIT"
] | 2 | 2019-04-05T16:17:28.000Z | 2020-05-17T12:55:20.000Z | """ Test utilities for testing
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2019-10-31
:Copyright: 2019, Karr Lab
:License: MIT
"""
from scipy.constants import Avogadro
import os
import shutil
import tempfile
import unittest
from de_sim.simulation_config import SimulationConfig
from wc_sim.multialgorit... | 52.30625 | 109 | 0.556936 |
from scipy.constants import Avogadro
import os
import shutil
import tempfile
import unittest
from de_sim.simulation_config import SimulationConfig
from wc_sim.multialgorithm_simulation import MultialgorithmSimulation
from wc_sim.sim_config import WCSimulationConfig
from wc_sim.simulation import Simulation
from wc_sim... | true | true |
f707b9b5d7a17b991547f656a386101cbfa92cf6 | 630 | py | Python | manage.py | rudmanmrrod/watchin-sge | 4fd6d115844776a4763266bd7f0da02eb104f2b4 | [
"MIT"
] | null | null | null | manage.py | rudmanmrrod/watchin-sge | 4fd6d115844776a4763266bd7f0da02eb104f2b4 | [
"MIT"
] | 15 | 2019-06-28T13:29:00.000Z | 2022-02-10T13:04:27.000Z | manage.py | rudmanmrrod/watchin-crm | 4fd6d115844776a4763266bd7f0da02eb104f2b4 | [
"MIT"
] | 1 | 2019-06-23T22:08:40.000Z | 2019-06-23T22:08:40.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'WatchInSGE.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Imp... | 28.636364 | 74 | 0.684127 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'WatchInSGE.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f707ba5f9a433519d7a5c0fa0beed5db34669b0c | 2,333 | py | Python | chainer/functions/noise/zoneout.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | null | null | null | chainer/functions/noise/zoneout.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | null | null | null | chainer/functions/noise/zoneout.py | Evanc123/chainer | 929af7189b1271683200aa9b0ba6da2dd3dee110 | [
"MIT"
] | null | null | null | import numpy
from chainer.backends import cuda
from chainer import configuration
from chainer import function_node
from chainer.utils import argument
from chainer.utils import type_check
class Zoneout(function_node.FunctionNode):
"""Zoneout regularization."""
def __init__(self, zoneout_ratio):
self... | 29.1625 | 79 | 0.638663 | import numpy
from chainer.backends import cuda
from chainer import configuration
from chainer import function_node
from chainer.utils import argument
from chainer.utils import type_check
class Zoneout(function_node.FunctionNode):
def __init__(self, zoneout_ratio):
self.zoneout_ratio = zoneout_ratio
... | true | true |
f707baca67d5ac400a8642a3a09ab91d38f7b40d | 1,841 | py | Python | setup.py | Sage-Bionetworks/tool-registry-client | 88abc84a51e3843bff73b4f958571646d4ccc3cd | [
"Apache-2.0"
] | null | null | null | setup.py | Sage-Bionetworks/tool-registry-client | 88abc84a51e3843bff73b4f958571646d4ccc3cd | [
"Apache-2.0"
] | 1 | 2020-12-09T17:55:11.000Z | 2021-12-21T18:40:13.000Z | setup.py | Sage-Bionetworks/tool-registry-client | 88abc84a51e3843bff73b4f958571646d4ccc3cd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
# basic
name='tool-registry-client',
version='0.1.0',
# packages=setuptools.find_packages(exclude=["tests", "tests.*"]),
# py_modules=['hello'],
# scripts=['bin/nlp-eva... | 33.472727 | 103 | 0.632265 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='tool-registry-client',
version='0.1.0',
packages=setuptools.find_packages(),
entry_points={
},
python_requires='>=3.6.*',
install_requires=[
'... | true | true |
f707bcdaa7a7741b72aedb923c21c3cc3a57b457 | 724 | py | Python | mep/accounts/migrations/0019_allow_null_precision.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | 3 | 2020-05-12T19:19:41.000Z | 2021-04-07T13:56:32.000Z | mep/accounts/migrations/0019_allow_null_precision.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | 736 | 2017-06-21T16:24:42.000Z | 2022-02-26T17:46:10.000Z | mep/accounts/migrations/0019_allow_null_precision.py | making-books-ren-today/test_eval_3_shxco | 5a6427abeb4aec1aa70c0d9a4b32d028012780c8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-20 18:17
from __future__ import unicode_literals
from django.db import migrations
import mep.accounts.models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0018_merge_20180418_1607'),
]
operations = [
... | 26.814815 | 86 | 0.640884 | from __future__ import unicode_literals
from django.db import migrations
import mep.accounts.models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0018_merge_20180418_1607'),
]
operations = [
migrations.AlterField(
model_name='borrow',
name... | true | true |
f707bcfbcc2754c7894e88a284b9c8d6dc1beda8 | 2,976 | py | Python | packages/python/tests/ci/git_env.py | LaudateCorpus1/m | 57e258ddb1347f8e29673410e12575d203bb19c8 | [
"MIT"
] | null | null | null | packages/python/tests/ci/git_env.py | LaudateCorpus1/m | 57e258ddb1347f8e29673410e12575d203bb19c8 | [
"MIT"
] | null | null | null | packages/python/tests/ci/git_env.py | LaudateCorpus1/m | 57e258ddb1347f8e29673410e12575d203bb19c8 | [
"MIT"
] | 1 | 2021-12-31T13:25:33.000Z | 2021-12-31T13:25:33.000Z | from unittest.mock import patch
from m.ci.config import Config, GitFlowConfig, MFlowConfig, Workflow
from m.ci.git_env import GitEnv, get_git_env
from m.core import issue
from m.core.fp import Good
from m.core.io import EnvVars
from ..util import FpTestCase
class GitEnvTest(FpTestCase):
config = Config(
... | 32.347826 | 68 | 0.511425 | from unittest.mock import patch
from m.ci.config import Config, GitFlowConfig, MFlowConfig, Workflow
from m.ci.git_env import GitEnv, get_git_env
from m.core import issue
from m.core.fp import Good
from m.core.io import EnvVars
from ..util import FpTestCase
class GitEnvTest(FpTestCase):
config = Config(
... | true | true |
f707bd3e256af4b86d84f1b1920f35618103429e | 3,025 | py | Python | benchmark/startCirq2117.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq2117.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq2117.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=37
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 36.445783 | 77 | 0.684959 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0])) c.append(cirq.H.on(input_qubit[1])) c.append(c... | true | true |
f707be165739e0087fa738d5095f6a55983e7b80 | 4,453 | py | Python | mininet/dopOffice1_topo.py | Konstantin-Minachkin/Ryu_SDN_Controller | 2fd1c3e69b33a8db70ea1eb9303751c1afdaf4e9 | [
"Apache-2.0"
] | null | null | null | mininet/dopOffice1_topo.py | Konstantin-Minachkin/Ryu_SDN_Controller | 2fd1c3e69b33a8db70ea1eb9303751c1afdaf4e9 | [
"Apache-2.0"
] | null | null | null | mininet/dopOffice1_topo.py | Konstantin-Minachkin/Ryu_SDN_Controller | 2fd1c3e69b33a8db70ea1eb9303751c1afdaf4e9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Region office topology.
Office has tro floors
_________terminate_switch_____________________
| | |
switch-1-floor switch-2-floor
| | |
hosts switchF2 hosts
... | 35.624 | 75 | 0.534247 |
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.cli import CLI
from mininet.log import setLogLevel
from mininet.node import RemoteController, OVSSwitch
from functools import partial
class MyTopo( Topo ):
def __init__( self, hosts_per_sw, hnum, tnum):
Topo._... | true | true |
f707be9122c5f2ae0d90397f5f92a7c44e559c95 | 3,657 | py | Python | demo/icdar2013_detection.py | muchwater/TextFuseNet_EfficientNet | 444ee48a9021f31422ca5a2d13aaffa79a950aa0 | [
"MIT"
] | 348 | 2020-09-22T10:27:20.000Z | 2022-03-31T08:17:18.000Z | demo/icdar2013_detection.py | muchwater/TextFuseNet_EfficientNet | 444ee48a9021f31422ca5a2d13aaffa79a950aa0 | [
"MIT"
] | 89 | 2020-09-24T04:31:54.000Z | 2022-03-31T07:46:22.000Z | demo/icdar2013_detection.py | muchwater/TextFuseNet_EfficientNet | 444ee48a9021f31422ca5a2d13aaffa79a950aa0 | [
"MIT"
] | 102 | 2020-09-24T11:30:07.000Z | 2022-03-24T12:18:37.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import glob
import multiprocessing as mp
import os
import time
import cv2
import tqdm
import numpy as np
from detectron2.config import get_cfg
from detectron2.data.detection_utils import read_image
from detectron2.utils.logger impor... | 28.348837 | 97 | 0.649166 | import argparse
import glob
import multiprocessing as mp
import os
import time
import cv2
import tqdm
import numpy as np
from detectron2.config import get_cfg
from detectron2.data.detection_utils import read_image
from detectron2.utils.logger import setup_logger
from predictor import VisualizationDemo
WINDOW_NAME = ... | true | true |
f707bf07c1bddf492074314149653fdbdd798735 | 495 | py | Python | stx/utils/stack.py | bakasoft/stx | ef6ad209c2acaed83df37f8ebbec52ffc0ff1909 | [
"MIT"
] | 1 | 2020-04-07T04:42:11.000Z | 2020-04-07T04:42:11.000Z | stx/utils/stack.py | stx-lang/python-stx | ef6ad209c2acaed83df37f8ebbec52ffc0ff1909 | [
"MIT"
] | 6 | 2020-03-21T20:16:07.000Z | 2020-04-10T02:53:38.000Z | stx/utils/stack.py | stx-lang/python-stx | ef6ad209c2acaed83df37f8ebbec52ffc0ff1909 | [
"MIT"
] | null | null | null | from typing import Generic, TypeVar, List, Optional
T = TypeVar('T')
class Stack(Generic[T]):
def __init__(self):
self.items: List[T] = []
def empty(self) -> bool:
return len(self.items) == 0
def push(self, item: T):
self.items.append(item)
def pop(self) -> T:
retu... | 19.8 | 63 | 0.567677 | from typing import Generic, TypeVar, List, Optional
T = TypeVar('T')
class Stack(Generic[T]):
def __init__(self):
self.items: List[T] = []
def empty(self) -> bool:
return len(self.items) == 0
def push(self, item: T):
self.items.append(item)
def pop(self) -> T:
retu... | true | true |
f707bf37626295dfe090a7a114f70e0c595e03b1 | 272 | py | Python | zinnia/tests/implementations/custom_url_shortener.py | Boondockers-Welcome/django-blog-zinnia | 34aa1e7304f6686c61da81fbd93d082e5cd3144b | [
"BSD-3-Clause"
] | 1,522 | 2015-01-02T05:54:02.000Z | 2022-03-31T04:13:14.000Z | zinnia/tests/implementations/custom_url_shortener.py | Boondockers-Welcome/django-blog-zinnia | 34aa1e7304f6686c61da81fbd93d082e5cd3144b | [
"BSD-3-Clause"
] | 205 | 2015-01-02T19:29:37.000Z | 2022-03-11T23:19:49.000Z | zinnia/tests/implementations/custom_url_shortener.py | Boondockers-Welcome/django-blog-zinnia | 34aa1e7304f6686c61da81fbd93d082e5cd3144b | [
"BSD-3-Clause"
] | 632 | 2015-01-02T05:54:02.000Z | 2022-03-25T17:07:32.000Z | """Custom url shortener backend for testing Zinnia"""
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured('This backend only exists for testing')
def backend(entry):
"""Custom url shortener backend for testing Zinnia"""
return ''
| 27.2 | 66 | 0.768382 | from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured('This backend only exists for testing')
def backend(entry):
return ''
| true | true |
f707bfbef627ade68ba3332bb3383f70ec53f6b8 | 4,069 | py | Python | neptune/new/attributes/series/file_series.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 254 | 2020-01-27T14:18:57.000Z | 2022-03-31T21:40:33.000Z | neptune/new/attributes/series/file_series.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 160 | 2020-02-05T11:00:22.000Z | 2022-03-31T08:50:24.000Z | neptune/new/attributes/series/file_series.py | Raalsky/neptune-client | 24ac58581774e61056d49cd1a22727799c14ad54 | [
"Apache-2.0"
] | 23 | 2020-02-07T09:19:50.000Z | 2022-02-15T09:52:56.000Z | #
# Copyright (c) 2020, Neptune Labs Sp. z o.o.
#
# 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 agr... | 34.777778 | 85 | 0.65102 | import imghdr
import os
import pathlib
from typing import List, Optional, Iterable
from neptune.new.internal.utils import base64_encode
from neptune.new.exceptions import FileNotFound, OperationNotSupported
from neptune.new.types import File
from neptune.new.types.series.file_series import FileSeries as FileSeriesV... | true | true |
f707c07871c15298e2d268bba3388571e000b0b5 | 3,266 | py | Python | tests/commands/test_changeprefixcommand.py | matthew-robertson/banned-word-tracker | 32defe7936114258325ef8ba2f740648d43d4abf | [
"MIT"
] | 11 | 2019-03-10T18:31:59.000Z | 2021-02-13T12:42:44.000Z | tests/commands/test_changeprefixcommand.py | matthew-robertson/banned-word-tracker | 32defe7936114258325ef8ba2f740648d43d4abf | [
"MIT"
] | 51 | 2019-02-21T21:21:59.000Z | 2022-03-09T01:29:55.000Z | tests/commands/test_changeprefixcommand.py | matthew-robertson/vore-tracker | c35807612397ae7bc540cb0a1af6bf3ec1f98593 | [
"MIT"
] | 5 | 2018-07-12T06:36:29.000Z | 2019-01-09T04:11:19.000Z | import unittest
from unittest.mock import patch, Mock
import discord
import datetime
from commands import ChangePrefixCommand
from serverobjects.server import DiscordServer
class TestChangePrefixCommand(unittest.TestCase):
def setUp(self):
self.command = ChangePrefixCommand()
self.time = datetime.datetime.now()
... | 31.403846 | 110 | 0.671464 | import unittest
from unittest.mock import patch, Mock
import discord
import datetime
from commands import ChangePrefixCommand
from serverobjects.server import DiscordServer
class TestChangePrefixCommand(unittest.TestCase):
def setUp(self):
self.command = ChangePrefixCommand()
self.time = datetime.datetime.now()
... | true | true |
f707c090c7c47b564eeb606a924569db3db76f3e | 32,286 | py | Python | StackApp/env/lib/python2.7/site-packages/psycopg2/tests/dbapi20.py | jonathanmusila/StackOverflow-Lite | a9a03f129592c6f741eb4d1e608ca2db0e40bf11 | [
"MIT"
] | 34 | 2016-09-30T17:17:58.000Z | 2022-02-04T15:53:09.000Z | StackApp/env/lib/python2.7/site-packages/psycopg2/tests/dbapi20.py | jonathanmusila/StackOverflow-Lite | a9a03f129592c6f741eb4d1e608ca2db0e40bf11 | [
"MIT"
] | 23 | 2016-07-21T17:51:07.000Z | 2018-11-29T15:09:06.000Z | StackApp/env/lib/python2.7/site-packages/psycopg2/tests/dbapi20.py | jonathanmusila/StackOverflow-Lite | a9a03f129592c6f741eb4d1e608ca2db0e40bf11 | [
"MIT"
] | 18 | 2016-09-30T17:44:05.000Z | 2021-12-23T07:55:11.000Z | #!/usr/bin/env python
''' Python DB API 2.0 driver compliance unit test suite.
This software is Public Domain and may be used without restrictions.
"Now we have booze and barflies entering the discussion, plus rumours of
DBAs on drugs... and I won't tell you what flashes through my mind each
time I read... | 36.982818 | 80 | 0.563805 |
__rcs_id__ = '$Id: dbapi20.py,v 1.11 2005/01/02 02:41:01 zenzen Exp $'
__version__ = '$Revision: 1.12 $'[11:-2]
__author__ = 'Stuart Bishop <stuart@stuartbishop.net>'
import unittest
import time
import sys
def str2bytes(sval):
if sys.version_info < (3,0) and isinstance(sval, str):
sval = sval.decode("l... | true | true |
f707c0ae92a93fe6a51157199678cfdc29d63820 | 647 | py | Python | detectron2/modeling/roi_heads/__init__.py | MargeryLab/BMaskR-CNN | 41f63d301d6be7fa30ba281a5a0f727fbca6ad2a | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/roi_heads/__init__.py | MargeryLab/BMaskR-CNN | 41f63d301d6be7fa30ba281a5a0f727fbca6ad2a | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/roi_heads/__init__.py | MargeryLab/BMaskR-CNN | 41f63d301d6be7fa30ba281a5a0f727fbca6ad2a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .box_head import ROI_BOX_HEAD_REGISTRY, build_box_head
from .keypoint_head import ROI_KEYPOINT_HEAD_REGISTRY, build_keypoint_head, BaseKeypointRCNNHead
from .mask_head import ROI_MASK_HEAD_REGISTRY, build_mask_head, BaseMaskRCNNHead
from .r... | 34.052632 | 97 | 0.788253 | from .box_head import ROI_BOX_HEAD_REGISTRY, build_box_head
from .keypoint_head import ROI_KEYPOINT_HEAD_REGISTRY, build_keypoint_head, BaseKeypointRCNNHead
from .mask_head import ROI_MASK_HEAD_REGISTRY, build_mask_head, BaseMaskRCNNHead
from .roi_heads import (
ROI_HEADS_REGISTRY,
ROIHeads,
Res5ROIHe... | true | true |
f707c12de9ebdb3505ba90ea1666b679abd69286 | 3,352 | py | Python | main.py | JustKappaMan/Ugly-Text-Editor | 40fb9e72afde335335adec25bdebbdee1f5c44e7 | [
"MIT"
] | null | null | null | main.py | JustKappaMan/Ugly-Text-Editor | 40fb9e72afde335335adec25bdebbdee1f5c44e7 | [
"MIT"
] | null | null | null | main.py | JustKappaMan/Ugly-Text-Editor | 40fb9e72afde335335adec25bdebbdee1f5c44e7 | [
"MIT"
] | null | null | null | import os.path
import tkinter as tk
import tkinter.filedialog as fd
import tkinter.messagebox as mb
def main():
text_editor = TextEditor()
text_editor.mainloop()
class TextEditor(tk.Tk):
def __init__(self):
super(TextEditor, self).__init__()
self.title('Ugly Text Editor')
self.... | 34.916667 | 109 | 0.627685 | import os.path
import tkinter as tk
import tkinter.filedialog as fd
import tkinter.messagebox as mb
def main():
text_editor = TextEditor()
text_editor.mainloop()
class TextEditor(tk.Tk):
def __init__(self):
super(TextEditor, self).__init__()
self.title('Ugly Text Editor')
self.... | true | true |
f707c1f72b166d564102c71fd7bea8a334d81170 | 10,269 | py | Python | tests/unit/peapods/runtimes/gateway/http/test_models.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | 1 | 2021-12-18T06:54:49.000Z | 2021-12-18T06:54:49.000Z | tests/unit/peapods/runtimes/gateway/http/test_models.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | 2 | 2021-12-17T15:22:12.000Z | 2021-12-18T07:19:06.000Z | tests/unit/peapods/runtimes/gateway/http/test_models.py | Akshat-unt/jina | b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717 | [
"Apache-2.0"
] | null | null | null | import pydantic
import pytest
from jina.peapods.runtimes.gateway.http.models import (
PROTO_TO_PYDANTIC_MODELS,
JinaRequestModel,
)
from jina.types.document import Document
from tests import random_docs
def test_schema_invocation():
for v in vars(PROTO_TO_PYDANTIC_MODELS).values():
v.schema()
... | 33.558824 | 88 | 0.637258 | import pydantic
import pytest
from jina.peapods.runtimes.gateway.http.models import (
PROTO_TO_PYDANTIC_MODELS,
JinaRequestModel,
)
from jina.types.document import Document
from tests import random_docs
def test_schema_invocation():
for v in vars(PROTO_TO_PYDANTIC_MODELS).values():
v.schema()
... | true | true |
f707c234f80c2a7b484c963a5e239100d01184f1 | 20,460 | py | Python | src/cogent3/evolve/parameter_controller.py | rahulghangas/cogent3 | f00cf822efce5f3141b3c7dafac81cb94a311e22 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/evolve/parameter_controller.py | rahulghangas/cogent3 | f00cf822efce5f3141b3c7dafac81cb94a311e22 | [
"BSD-3-Clause"
] | null | null | null | src/cogent3/evolve/parameter_controller.py | rahulghangas/cogent3 | f00cf822efce5f3141b3c7dafac81cb94a311e22 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
This file defines a class for controlling the scope and heterogeneity of
parameters involved in a maximum-likelihood based tree analysis.
"""
import pickle
import warnings
import numpy
from cogent3.align import dp_calculation
from cogent3.align.pairwise import AlignableSeq
from cogent3.cor... | 34.795918 | 88 | 0.575513 |
import pickle
import warnings
import numpy
from cogent3.align import dp_calculation
from cogent3.align.pairwise import AlignableSeq
from cogent3.core.tree import TreeError
from cogent3.evolve import likelihood_calculation
from cogent3.evolve.likelihood_function import LikelihoodFunction as _LF
from cogent3.maths.st... | true | true |
f707c24839da39506721babe09f891449d8663ef | 1,036 | py | Python | bmat_app/migrations/0001_initial.py | dlouky/bmat_test_dlouky | 970cbfb04c2f55a1a29ffb09b94db360720b36e1 | [
"MIT"
] | null | null | null | bmat_app/migrations/0001_initial.py | dlouky/bmat_test_dlouky | 970cbfb04c2f55a1a29ffb09b94db360720b36e1 | [
"MIT"
] | null | null | null | bmat_app/migrations/0001_initial.py | dlouky/bmat_test_dlouky | 970cbfb04c2f55a1a29ffb09b94db360720b36e1 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-05 08:34
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="MusicalWork",
fields=[
... | 28 | 82 | 0.454633 |
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="MusicalWork",
fields=[
(
"id",
... | true | true |
f707c3d48ff3381958bab352d03ceae35bf3abc1 | 1,280 | py | Python | tests/test_examples_app.py | kprzerwa/cds-migrator-kit | 443126e435483be460b0d48295f4878ada1e9445 | [
"MIT"
] | null | null | null | tests/test_examples_app.py | kprzerwa/cds-migrator-kit | 443126e435483be460b0d48295f4878ada1e9445 | [
"MIT"
] | null | null | null | tests/test_examples_app.py | kprzerwa/cds-migrator-kit | 443126e435483be460b0d48295f4878ada1e9445 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# cds-migrator-kit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Test example app."""
import os
import signal
import subprocess
import ti... | 24.615385 | 77 | 0.690625 |
import os
import signal
import subprocess
import time
from os.path import abspath, dirname, join
import pytest
@pytest.yield_fixture
def example_app():
current_dir = os.getcwd()
project_dir = dirname(dirname(abspath(__file__)))
exampleapp_dir = join(project_dir, 'examples')
os.chdir(exampleapp... | true | true |
f707c417fb0814be2f4aec97fbb1c3e8d5524efa | 1,189 | py | Python | flowcelltool/flowcells/migrations/0006_auto_20180320_0622.py | bihealth/flowcelltool | 6e16190fc34c54d834ecd23888a462f3af47611d | [
"MIT"
] | 7 | 2016-10-12T12:56:09.000Z | 2020-10-27T17:08:09.000Z | flowcelltool/flowcells/migrations/0006_auto_20180320_0622.py | iamh2o/flowcelltool | 6e16190fc34c54d834ecd23888a462f3af47611d | [
"MIT"
] | 94 | 2016-10-24T06:28:31.000Z | 2018-08-06T10:35:13.000Z | flowcelltool/flowcells/migrations/0006_auto_20180320_0622.py | iamh2o/flowcelltool | 6e16190fc34c54d834ecd23888a462f3af47611d | [
"MIT"
] | 1 | 2022-03-23T15:57:16.000Z | 2022-03-23T15:57:16.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-03-20 06:22
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('flowcells', '0005_auto_20180319_0947'),
]
operations = [
migrat... | 28.309524 | 71 | 0.583684 | from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('flowcells', '0005_auto_20180319_0947'),
]
operations = [
migrations.AddField(
model_name='barcodeset',
name='uui... | true | true |
f707c48e4faab8a4f1b78efa7e6f01738bce697e | 5,615 | py | Python | ctf/2021 Google/piet_interpreter/GUI/main.py | jacobshu/binder | 517494d688fd4b92f53e005daaea3d1b8e3083d6 | [
"MIT"
] | 12 | 2020-11-14T22:59:38.000Z | 2022-03-14T00:51:03.000Z | ctf/2021 Google/piet_interpreter/GUI/main.py | jacobshu/binder | 517494d688fd4b92f53e005daaea3d1b8e3083d6 | [
"MIT"
] | 2 | 2020-11-23T09:22:47.000Z | 2021-09-15T12:25:02.000Z | ctf/2021 Google/piet_interpreter/GUI/main.py | jacobshu/binder | 517494d688fd4b92f53e005daaea3d1b8e3083d6 | [
"MIT"
] | 5 | 2020-10-26T12:12:14.000Z | 2022-01-30T01:42:16.000Z | import pygubu
import os
from interpreter import imageFunctions as imageWrapper
from interpreter import lexer as lexer
from interpreter import executeFunctions as main
from interpreter.dataStructures import programState, direction, position
from GUI import infoManager
from GUI import canvasManager
class GUI:
def... | 38.197279 | 170 | 0.674443 | import pygubu
import os
from interpreter import imageFunctions as imageWrapper
from interpreter import lexer as lexer
from interpreter import executeFunctions as main
from interpreter.dataStructures import programState, direction, position
from GUI import infoManager
from GUI import canvasManager
class GUI:
def... | true | true |
f707c5264e6ec80e70ed71e7ceed1450558bb7d9 | 6,126 | py | Python | PCN/PyPCN.py | End-of-an-Era/PCN | 3a2564caacad75c1351f5aca5d45bf246bcaa2d9 | [
"BSD-2-Clause"
] | 317 | 2018-04-17T07:06:02.000Z | 2018-10-19T01:42:30.000Z | PCN/PyPCN.py | DefTruth/FaceKit | 043c3063014166d831c07197d4e6748e824a5587 | [
"BSD-2-Clause"
] | 45 | 2019-01-14T18:17:01.000Z | 2019-11-05T08:11:09.000Z | PCN/PyPCN.py | DefTruth/FaceKit | 043c3063014166d831c07197d4e6748e824a5587 | [
"BSD-2-Clause"
] | 86 | 2018-04-17T09:02:02.000Z | 2018-10-18T11:14:31.000Z | #!/usr/bin/python3
from ctypes import *
import cv2
import numpy as np
import sys
import os
import time
from ipdb import set_trace as dbg
from enum import IntEnum
class CPoint(Structure):
_fields_ = [("x", c_int),
("y", c_int)]
FEAT_POINTS = 14
class CWindow(Structure):
_fields_ = [("x", c_int)... | 33.845304 | 99 | 0.616389 | from ctypes import *
import cv2
import numpy as np
import sys
import os
import time
from ipdb import set_trace as dbg
from enum import IntEnum
class CPoint(Structure):
_fields_ = [("x", c_int),
("y", c_int)]
FEAT_POINTS = 14
class CWindow(Structure):
_fields_ = [("x", c_int),
(... | true | true |
f707c5fad6d4f32d6fa459e9433bae461f6298ac | 1,049 | py | Python | dataproc/google/cloud/dataproc.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2019-04-16T08:13:06.000Z | 2019-04-16T08:13:06.000Z | dataproc/google/cloud/dataproc.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | null | null | null | dataproc/google/cloud/dataproc.py | erikwebb/google-cloud-python | 288a878e9a07239015c78a193eca1cc15e926127 | [
"Apache-2.0"
] | 1 | 2020-11-15T11:44:36.000Z | 2020-11-15T11:44:36.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 32.78125 | 74 | 0.775024 |
from __future__ import absolute_import
from google.cloud.dataproc_v1 import ClusterControllerClient
from google.cloud.dataproc_v1 import JobControllerClient
from google.cloud.dataproc_v1 import WorkflowTemplateServiceClient
from google.cloud.dataproc_v1 import enums
from google.cloud.dataproc_v1 import types
__all__... | true | true |
f707c6154d1287ce9821836e38935dafa47e3ce9 | 13,454 | py | Python | examples/evaluate.py | Nstats/cs_capsule | e45a8518a41117d4b5f105bcc2c96a3d621e40ea | [
"Apache-2.0"
] | 1 | 2020-05-25T16:17:47.000Z | 2020-05-25T16:17:47.000Z | examples/evaluate.py | Nstats/cs_capsule | e45a8518a41117d4b5f105bcc2c96a3d621e40ea | [
"Apache-2.0"
] | null | null | null | examples/evaluate.py | Nstats/cs_capsule | e45a8518a41117d4b5f105bcc2c96a3d621e40ea | [
"Apache-2.0"
] | null | null | null | #*#*#*./examples/evaluate.py
"""Official evaluation script for SQuAD version 2.0.
In addition to basic functionality, we also compute additional statistics and
plot precision-recall curves if an additional na_prob.json file is provided.
This file is expected to map question ID's to the model's predicted probability
th... | 39.922849 | 138 | 0.676081 | import argparse
import collections
import json
import numpy as np
import os
import re
import string
import sys
OPTS = None
def parse_args():
parser = argparse.ArgumentParser('Official evaluation script for SQuAD version 2.0.')
parser.add_argument('data_file', metavar='data.json', help='Input data JSON file.')
pa... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.