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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c11b89845371c19afd0bc53d646568f01ea6858 | 17,752 | py | Python | dask/local.py | TryTestspace/dask | 86d4f7d8c6d48ec6c4b1de1b6cfd2d3f4e5a4c1b | [
"BSD-3-Clause"
] | null | null | null | dask/local.py | TryTestspace/dask | 86d4f7d8c6d48ec6c4b1de1b6cfd2d3f4e5a4c1b | [
"BSD-3-Clause"
] | null | null | null | dask/local.py | TryTestspace/dask | 86d4f7d8c6d48ec6c4b1de1b6cfd2d3f4e5a4c1b | [
"BSD-3-Clause"
] | null | null | null | """
Asynchronous Shared-Memory Scheduler for Dask Graphs.
This scheduler coordinates several workers to execute tasks in a dask graph in
parallel. It depends on an apply_async function as would be found in thread or
process Pools and a corresponding Queue for worker-to-scheduler communication.
It tries to execute ta... | 31.419469 | 88 | 0.608438 | from __future__ import absolute_import, division, print_function
import os
import sys
from .compatibility import Queue, Empty, reraise
from .core import (istask, flatten, reverse_dict, get_dependencies, ishashable,
has_tasks)
from . import config
from .order import order
from .callbacks import unpa... | true | true |
1c11b8a654807a5b1819e8eaf4713d1ef33f064c | 445 | py | Python | Others/past/past202104-open/j/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | Others/past/past202104-open/j/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | Others/past/past202104-open/j/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
from statistics import mean
import sys
input = sys.stdin.readline
n, c = map(int, input().split())
x = [0 for _ in range(n)]
ans = 0
for i in range(n):
xi, yi = map(int, input().split())
x[i] = xi
ans += abs(c - yi) ** 2
... | 15.892857 | 51 | 0.494382 |
def main():
from statistics import mean
import sys
input = sys.stdin.readline
n, c = map(int, input().split())
x = [0 for _ in range(n)]
ans = 0
for i in range(n):
xi, yi = map(int, input().split())
x[i] = xi
ans += abs(c - yi) ** 2
x_mean = mean(x)
ans... | true | true |
1c11b8f5592a8ea65ea267e8998c4a4e99ef9955 | 122 | py | Python | smsverification/controllers/__init__.py | axant/tgapp-smsverification | b8a2d720d372c0c6ffa1d0dc73dd20d258aa5ef5 | [
"MIT"
] | null | null | null | smsverification/controllers/__init__.py | axant/tgapp-smsverification | b8a2d720d372c0c6ffa1d0dc73dd20d258aa5ef5 | [
"MIT"
] | null | null | null | smsverification/controllers/__init__.py | axant/tgapp-smsverification | b8a2d720d372c0c6ffa1d0dc73dd20d258aa5ef5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Controllers for the smsverification pluggable application."""
from .root import RootController | 30.5 | 64 | 0.737705 |
from .root import RootController | true | true |
1c11b9b97f4a0f6b96270adf381847ada1f1556a | 35,518 | py | Python | environments/sumo/Utils.py | FazelYU/Adaptive-Navigation | 95d4aa7603fb416c5c4ebc4560724f85c93cee22 | [
"MIT"
] | null | null | null | environments/sumo/Utils.py | FazelYU/Adaptive-Navigation | 95d4aa7603fb416c5c4ebc4560724f85c93cee22 | [
"MIT"
] | null | null | null | environments/sumo/Utils.py | FazelYU/Adaptive-Navigation | 95d4aa7603fb416c5c4ebc4560724f85c93cee22 | [
"MIT"
] | null | null | null | import numpy
import torch
import json
import random
import traci
from inspect import currentframe, getframeinfo
import networkx as nx
import pymorton as pm
import pandas as pd
from sklearn.manifold import TSNE
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
fro... | 43.367521 | 174 | 0.627062 | import numpy
import torch
import json
import random
import traci
from inspect import currentframe, getframeinfo
import networkx as nx
import pymorton as pm
import pandas as pd
from sklearn.manifold import TSNE
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import seaborn as sns
fro... | true | true |
1c11baf3b886eea2b960b3bb64df86fbadabbbb9 | 1,783 | py | Python | vsts/vsts/work_item_tracking/v4_0/models/work_item_history.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/work_item_tracking/v4_0/models/work_item_history.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/work_item_tracking/v4_0/models/work_item_history.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 40.522727 | 104 | 0.554122 |
from .work_item_tracking_resource import WorkItemTrackingResource
class WorkItemHistory(WorkItemTrackingResource):
_attribute_map = {
'url': {'key': 'url', 'type': 'str'},
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
'rev': {'key': 'rev', 'type': 'int'},
'revised_by': {... | true | true |
1c11bb0632bd81e5beec86901f38cdbf23c56516 | 132 | py | Python | admin/users/urls.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | null | null | null | admin/users/urls.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | 13 | 2020-03-24T15:29:41.000Z | 2022-03-11T23:15:28.000Z | admin/users/urls.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.UserFormView.as_view(), name='user'),
]
| 16.5 | 58 | 0.674242 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.UserFormView.as_view(), name='user'),
]
| true | true |
1c11bdc8bc6a53ad277d5297feba72b4ea01181b | 2,288 | py | Python | tests/test_panel.py | lodagro/rich | 230af6ef70b3a1404a0405b148cf5737db7ae1fb | [
"MIT"
] | 1 | 2021-05-22T18:03:45.000Z | 2021-05-22T18:03:45.000Z | tests/test_panel.py | lodagro/rich | 230af6ef70b3a1404a0405b148cf5737db7ae1fb | [
"MIT"
] | 76 | 2020-07-31T05:33:39.000Z | 2022-03-28T05:04:17.000Z | tests/test_panel.py | lodagro/rich | 230af6ef70b3a1404a0405b148cf5737db7ae1fb | [
"MIT"
] | 1 | 2021-06-09T19:30:52.000Z | 2021-06-09T19:30:52.000Z | import io
from rich.console import Console
from rich.measure import Measurement
from rich.panel import Panel
import pytest
tests = [
Panel("Hello, World", padding=0),
Panel("Hello, World", expand=False, padding=0),
Panel.fit("Hello, World", padding=0),
Panel("Hello, World", width=8, padding=0),
Pa... | 36.31746 | 267 | 0.49257 | import io
from rich.console import Console
from rich.measure import Measurement
from rich.panel import Panel
import pytest
tests = [
Panel("Hello, World", padding=0),
Panel("Hello, World", expand=False, padding=0),
Panel.fit("Hello, World", padding=0),
Panel("Hello, World", width=8, padding=0),
Pa... | true | true |
1c11be0194863c32e455966590ba21f39794762d | 7,819 | py | Python | kubernetes/client/models/io_xk8s_cluster_infrastructure_v1alpha3_aws_cluster_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_xk8s_cluster_infrastructure_v1alpha3_aws_cluster_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/io_xk8s_cluster_infrastructure_v1alpha3_aws_cluster_list.py | mariusgheorghies/python | 68ac7e168963d8b5a81dc493b1973d29e903a15b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
fr... | 37.956311 | 312 | 0.664663 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class IoXK8sClusterInfrastructureV1alpha3AWSClusterList(object):
openapi_types = {
'api_version': 'str',
'items': 'list[IoXK8sClusterInfrastructureV1alpha3AWSCluster]',
'kind': 'str',
... | true | true |
1c11be0f8fc2e6eefd34098d66a2687e3ea6ea3c | 6,821 | py | Python | niftynet/network/scalenet.py | tdml13/NiftyNet | b35fa19ca307e81d229e2fe8269a417724833da2 | [
"Apache-2.0"
] | 1,403 | 2017-08-30T11:49:45.000Z | 2022-03-31T11:44:05.000Z | niftynet/network/scalenet.py | tdml13/NiftyNet | b35fa19ca307e81d229e2fe8269a417724833da2 | [
"Apache-2.0"
] | 360 | 2017-10-03T15:33:53.000Z | 2021-03-17T06:27:38.000Z | niftynet/network/scalenet.py | tdml13/NiftyNet | b35fa19ca307e81d229e2fe8269a417724833da2 | [
"Apache-2.0"
] | 464 | 2017-09-13T20:56:32.000Z | 2022-02-11T20:33:47.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import tensorflow as tf
from niftynet.layer.base_layer import TrainableLayer
from niftynet.layer.convolution import ConvolutionalLayer
from niftynet.network.base_net import BaseNet
from niftynet.network.highres3dnet import HighRes... | 37.685083 | 79 | 0.60431 | from __future__ import absolute_import, print_function, division
import tensorflow as tf
from niftynet.layer.base_layer import TrainableLayer
from niftynet.layer.convolution import ConvolutionalLayer
from niftynet.network.base_net import BaseNet
from niftynet.network.highres3dnet import HighRes3DNet, HighResBlock
from... | true | true |
1c11beee7521db8413763f2850eb611498f4a0ef | 645 | py | Python | pypro/modulos/views.py | ravellys/curso-django | 98c0fad20d7c9e5dcd3482eb37c43f9d65695184 | [
"MIT"
] | null | null | null | pypro/modulos/views.py | ravellys/curso-django | 98c0fad20d7c9e5dcd3482eb37c43f9d65695184 | [
"MIT"
] | 789 | 2020-09-02T01:46:12.000Z | 2022-03-31T23:55:42.000Z | pypro/modulos/views.py | ravellys/curso-django | 98c0fad20d7c9e5dcd3482eb37c43f9d65695184 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from pypro.modulos import facade
def indice(request):
ctx = {'modulos': facade.listar_modulos_com_aulas()}
return render(request, 'modulos/indice.html', ctx)
def detalhe(request, slug):
modulo = facade.encontr... | 29.318182 | 93 | 0.750388 | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from pypro.modulos import facade
def indice(request):
ctx = {'modulos': facade.listar_modulos_com_aulas()}
return render(request, 'modulos/indice.html', ctx)
def detalhe(request, slug):
modulo = facade.encontr... | true | true |
1c11bf8edcda8fb7ec4e8ee83912b7d4d01966d1 | 2,207 | py | Python | tensorflow_graph_in_jupyter.py | adtamayop/Ejercicios_NN | b5e9412ca03f6bb1f82ebe71a0c4ef16f80ec028 | [
"MIT"
] | null | null | null | tensorflow_graph_in_jupyter.py | adtamayop/Ejercicios_NN | b5e9412ca03f6bb1f82ebe71a0c4ef16f80ec028 | [
"MIT"
] | null | null | null | tensorflow_graph_in_jupyter.py | adtamayop/Ejercicios_NN | b5e9412ca03f6bb1f82ebe71a0c4ef16f80ec028 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
# This module defines the show_graph() function to visualize a TensorFlow graph within Jupyter.
# As far as I can tell, this code was originally written by Alex Mordvintsev at:
# https://github.com/tensorflow/tensorflow/blob/maste... | 44.14 | 111 | 0.655641 | from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import tensorflow as tf
from IPython.display import clear_output, Image, display, HTML
def strip_consts(graph_def, max_const_size=32):
strip_def = tf.GraphDef()
for n0 in graph_def.node:
... | true | true |
1c11c0c146e82c558aab7022ebf7b6bf8e6eddcc | 1,740 | py | Python | cogs/stats.py | Machotacoz/discord-bot | b7390fac8df9a0943fcab1d49bf6a54f88d287da | [
"MIT"
] | null | null | null | cogs/stats.py | Machotacoz/discord-bot | b7390fac8df9a0943fcab1d49bf6a54f88d287da | [
"MIT"
] | null | null | null | cogs/stats.py | Machotacoz/discord-bot | b7390fac8df9a0943fcab1d49bf6a54f88d287da | [
"MIT"
] | null | null | null | import discord, os
from discord.ext import commands
from utils import checks, output, parsing
from aiohttp import ClientSession
import urllib.request
import json
class Stats:
def __init__(self, bot: discord.ext.commands.Bot):
self.bot = bot
@commands.command(pass_context=True)
async def stats(self... | 43.5 | 168 | 0.628161 | import discord, os
from discord.ext import commands
from utils import checks, output, parsing
from aiohttp import ClientSession
import urllib.request
import json
class Stats:
def __init__(self, bot: discord.ext.commands.Bot):
self.bot = bot
@commands.command(pass_context=True)
async def stats(self... | true | true |
1c11c0f120502e36547cc50bf4f93c855e2e639c | 82,697 | py | Python | neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py | 2020human/neutron | 1e2cfe8c06fcc2df52daa77b2b767ed6ffc2b19f | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py | 2020human/neutron | 1e2cfe8c06fcc2df52daa77b2b767ed6ffc2b19f | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/services/l3_router/test_l3_dvr_router_plugin.py | 2020human/neutron | 1e2cfe8c06fcc2df52daa77b2b767ed6ffc2b19f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 50.058717 | 79 | 0.554724 |
import mock
from neutron_lib import constants
from neutron.api.rpc.handlers import l3_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import topics
from neutron import context
from neutron.extensions import external_net
from n... | true | true |
1c11c3e178de12978bf0eac954c42a10f3626a14 | 12,991 | py | Python | trojai_runner.py | dominiccarrano/backdoor-nn-geometry | d1fa0754f1d57a9b303e2eb71edf0787a86529c8 | [
"MIT"
] | 1 | 2021-05-28T14:57:57.000Z | 2021-05-28T14:57:57.000Z | trojai_runner.py | dominiccarrano/backdoor-nn-geometry | d1fa0754f1d57a9b303e2eb71edf0787a86529c8 | [
"MIT"
] | null | null | null | trojai_runner.py | dominiccarrano/backdoor-nn-geometry | d1fa0754f1d57a9b303e2eb71edf0787a86529c8 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import torch
import os
import argparse
from torch.utils.data import DataLoader, sampler, TensorDataset, ConcatDataset
from attack_functions import *
from trojai_utils import *
from boundary_geometry import *
parser = argparse.ArgumentParser(description="TrojAI Round 5 script for ... | 72.172222 | 280 | 0.549996 | import numpy as np
import pandas as pd
import torch
import os
import argparse
from torch.utils.data import DataLoader, sampler, TensorDataset, ConcatDataset
from attack_functions import *
from trojai_utils import *
from boundary_geometry import *
parser = argparse.ArgumentParser(description="TrojAI Round 5 script for ... | true | true |
1c11c4017b7360d5ebe0f326aa7305009191863f | 1,013 | py | Python | superset/db_engine_specs/databricks.py | Altinity/superset | 2e003cea822188fa026b40cc31b5b3be54cfa98f | [
"Apache-2.0"
] | 2 | 2021-09-13T07:20:49.000Z | 2021-11-14T20:06:47.000Z | superset/db_engine_specs/databricks.py | Altinity/superset | 2e003cea822188fa026b40cc31b5b3be54cfa98f | [
"Apache-2.0"
] | 61 | 2020-08-13T04:22:44.000Z | 2022-03-21T22:39:08.000Z | superset/db_engine_specs/databricks.py | Altinity/superset | 2e003cea822188fa026b40cc31b5b3be54cfa98f | [
"Apache-2.0"
] | 1 | 2021-08-28T09:49:15.000Z | 2021-08-28T09:49:15.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.961538 | 62 | 0.770977 |
from superset.db_engine_specs.hive import HiveEngineSpec
class DatabricksHiveEngineSpec(HiveEngineSpec):
engine = "databricks"
engine_name = "Databricks"
driver = "pyhive"
_show_functions_column = "function"
| true | true |
1c11c5862f8a73efebfe0b433e23d23d1d628f57 | 13,176 | py | Python | segmentation_models_pytorch/encoders/timm_regnet.py | vietnhatthai/segmentation_models.pytorch | 8bf52c7e862af006e76a23aae6aa17977d7f9a79 | [
"MIT"
] | 3 | 2022-03-15T07:36:58.000Z | 2022-03-16T03:05:59.000Z | segmentation_models_pytorch/encoders/timm_regnet.py | litvinich/segmentation_models.pytorch | 9052aa2a4f09a600f687120e69ad2b57c04cc0dd | [
"MIT"
] | null | null | null | segmentation_models_pytorch/encoders/timm_regnet.py | litvinich/segmentation_models.pytorch | 9052aa2a4f09a600f687120e69ad2b57c04cc0dd | [
"MIT"
] | 1 | 2022-01-12T12:33:43.000Z | 2022-01-12T12:33:43.000Z | from ._base import EncoderMixin
from timm.models.regnet import RegNet
import torch.nn as nn
class RegNetEncoder(RegNet, EncoderMixin):
def __init__(self, out_channels, depth=5, **kwargs):
super().__init__(**kwargs)
self._depth = depth
self._out_channels = out_channels
self._in_chan... | 39.567568 | 139 | 0.587204 | from ._base import EncoderMixin
from timm.models.regnet import RegNet
import torch.nn as nn
class RegNetEncoder(RegNet, EncoderMixin):
def __init__(self, out_channels, depth=5, **kwargs):
super().__init__(**kwargs)
self._depth = depth
self._out_channels = out_channels
self._in_chan... | true | true |
1c11c5aeb913ff6133fe8d08c10e70f51432bdf3 | 8,441 | py | Python | nototools/mti_cmap_data.py | andycanderson/nototools | 5ad53e32b33ceac477085b85858164778e2c7d17 | [
"Apache-2.0"
] | null | null | null | nototools/mti_cmap_data.py | andycanderson/nototools | 5ad53e32b33ceac477085b85858164778e2c7d17 | [
"Apache-2.0"
] | null | null | null | nototools/mti_cmap_data.py | andycanderson/nototools | 5ad53e32b33ceac477085b85858164778e2c7d17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Google 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... | 33.101961 | 87 | 0.671958 |
import argparse
from os import path
import sys
from nototools import cmap_data
from nototools import tool_utils
from nototools import unicode_data
_SCRIPT_KEY_NAMES = [
('SYM2', 'Symbols2')
]
def get_script_for_name(script_name):
starred = False
added = False
if script_name[-1] == '*':
starred = True... | true | true |
1c11c78c290ed54c3326cd3a1508c9417f3a7d43 | 10,061 | py | Python | manimlib/mobject/svg/text_mobject.py | Ermaotie/manim | b25e446042571bf80b47198adfe230e0cb1b9637 | [
"MIT"
] | 1 | 2021-07-11T21:38:13.000Z | 2021-07-11T21:38:13.000Z | manimlib/mobject/svg/text_mobject.py | Ermaotie/manim | b25e446042571bf80b47198adfe230e0cb1b9637 | [
"MIT"
] | null | null | null | manimlib/mobject/svg/text_mobject.py | Ermaotie/manim | b25e446042571bf80b47198adfe230e0cb1b9637 | [
"MIT"
] | null | null | null | import copy
import hashlib
import os
import re
import typing
import warnings
from contextlib import contextmanager
from pathlib import Path
import manimpango
from manimlib.constants import *
from manimlib.mobject.geometry import Dot
from manimlib.mobject.svg.svg_mobject import SVGMobject
from manimlib.mobject.types.ve... | 33.875421 | 96 | 0.567439 | import copy
import hashlib
import os
import re
import typing
import warnings
from contextlib import contextmanager
from pathlib import Path
import manimpango
from manimlib.constants import *
from manimlib.mobject.geometry import Dot
from manimlib.mobject.svg.svg_mobject import SVGMobject
from manimlib.mobject.types.ve... | true | true |
1c11c88feb6529ff3bba7756d2257396829a3133 | 16,954 | py | Python | tests/test_bidsIncremental.py | KailongPeng/rt-cloud | c19d524b9fa6f15966f1c0c4dd6fcbe55b386126 | [
"Apache-2.0"
] | 1 | 2021-03-15T18:34:11.000Z | 2021-03-15T18:34:11.000Z | tests/test_bidsIncremental.py | KailongPeng/rt-cloud | c19d524b9fa6f15966f1c0c4dd6fcbe55b386126 | [
"Apache-2.0"
] | null | null | null | tests/test_bidsIncremental.py | KailongPeng/rt-cloud | c19d524b9fa6f15966f1c0c4dd6fcbe55b386126 | [
"Apache-2.0"
] | 2 | 2021-02-23T22:53:43.000Z | 2021-02-23T23:11:57.000Z | from copy import deepcopy
import logging
import os
import pickle
from bids.layout import BIDSImageFile
from bids.layout.writing import build_path as bids_build_path
import nibabel as nib
import numpy as np
import pandas as pd
import pytest
from rtCommon.bidsCommon import (
BIDS_DIR_PATH_PATTERN,
BIDS_FILE_PAT... | 38.974713 | 80 | 0.713932 | from copy import deepcopy
import logging
import os
import pickle
from bids.layout import BIDSImageFile
from bids.layout.writing import build_path as bids_build_path
import nibabel as nib
import numpy as np
import pandas as pd
import pytest
from rtCommon.bidsCommon import (
BIDS_DIR_PATH_PATTERN,
BIDS_FILE_PAT... | true | true |
1c11c94a21c1c8c06f5921f3b27ca43597aab38e | 4,581 | py | Python | contrib/harbor-cli/harborclient/utils.py | eirinikos/harbor | efb3759d147ad225e00f161a49ab1e9ed4542b1f | [
"Apache-2.0"
] | 1 | 2019-07-29T10:37:18.000Z | 2019-07-29T10:37:18.000Z | contrib/harbor-cli/harborclient/utils.py | hjimmy/harbor | b308c6e4fc3540d03eae7d7c3146f63dab8e52c5 | [
"Apache-2.0"
] | 2 | 2018-03-28T14:58:09.000Z | 2020-02-19T00:47:42.000Z | contrib/harbor-cli/harborclient/utils.py | hjimmy/harbor | b308c6e4fc3540d03eae7d7c3146f63dab8e52c5 | [
"Apache-2.0"
] | 4 | 2017-10-16T17:34:28.000Z | 2018-03-27T15:08:09.000Z | import contextlib
import os
import textwrap
import time
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
import prettytable
import six
def env(*args, **kwargs):
"""Returns the first environment variable set.
If all are empty, defaults to '' or keyword arg `default`.
"""
fo... | 27.596386 | 79 | 0.573456 | import contextlib
import os
import textwrap
import time
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
import prettytable
import six
def env(*args, **kwargs):
for arg in args:
value = os.environ.get(arg)
if value:
return value
return kwargs.get('defaul... | true | true |
1c11c991b6f88390762a3af33127de8644c0204d | 653 | py | Python | e2e_tests/tests/command/test_shell.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | 1 | 2021-03-29T13:39:45.000Z | 2021-03-29T13:39:45.000Z | e2e_tests/tests/command/test_shell.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | null | null | null | e2e_tests/tests/command/test_shell.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import pytest
import determined as det
from tests import command as cmd
@pytest.mark.slow # type: ignore
@pytest.mark.e2e_gpu # type: ignore
def test_start_and_write_to_shell(tmp_path: Path) -> None:
with cmd.interactive_command("shell", "start") as shell:
# Call our cli to en... | 29.681818 | 90 | 0.669219 | from pathlib import Path
import pytest
import determined as det
from tests import command as cmd
@pytest.mark.slow @pytest.mark.e2e_gpu def test_start_and_write_to_shell(tmp_path: Path) -> None:
with cmd.interactive_command("shell", "start") as shell:
shell.stdin.write(b"det --version\n")
... | true | true |
1c11c9fe5994596a540ba1b4889216531b2b3a69 | 1,368 | py | Python | effect/test_intents.py | tomprince/effect | 56ec44525f1ff74f9d3f8d9489a93285e2f52cd5 | [
"Unlicense",
"MIT"
] | null | null | null | effect/test_intents.py | tomprince/effect | 56ec44525f1ff74f9d3f8d9489a93285e2f52cd5 | [
"Unlicense",
"MIT"
] | null | null | null | effect/test_intents.py | tomprince/effect | 56ec44525f1ff74f9d3f8d9489a93285e2f52cd5 | [
"Unlicense",
"MIT"
] | null | null | null | from __future__ import print_function, absolute_import
from testtools import TestCase
from ._base import Effect
from ._sync import sync_perform
from .dispatcher import TypeDispatcher
from ._intents import (
ConstantIntent, perform_constant,
ErrorIntent, perform_error,
FuncIntent, perform_func,
)
class ... | 27.918367 | 64 | 0.634503 | from __future__ import print_function, absolute_import
from testtools import TestCase
from ._base import Effect
from ._sync import sync_perform
from .dispatcher import TypeDispatcher
from ._intents import (
ConstantIntent, perform_constant,
ErrorIntent, perform_error,
FuncIntent, perform_func,
)
class ... | true | true |
1c11ca33a115761806e865e47752bc6740db913e | 1,184 | py | Python | nmag-www-archive/nmag.soton.ac.uk/nmag/0.2/manual/singlehtml/_downloads/stt.py | nmag-project/nmag-project.github.io | 4bcde6fc0da983ebc53ca4487eadb8af22de9480 | [
"BSD-3-Clause"
] | 1 | 2021-10-01T09:14:14.000Z | 2021-10-01T09:14:14.000Z | nmag-www-archive/nmag.soton.ac.uk/nmag/0.2/manual/singlehtml/_downloads/stt.py | nmag-project/nmag-project.github.io | 4bcde6fc0da983ebc53ca4487eadb8af22de9480 | [
"BSD-3-Clause"
] | 2 | 2021-09-10T18:43:26.000Z | 2021-09-10T18:50:55.000Z | nmag-www-archive/nmag.soton.ac.uk/nmag/current/manual/singlehtml/_downloads/stt.py | nmag-project/nmag-project.github.io | 4bcde6fc0da983ebc53ca4487eadb8af22de9480 | [
"BSD-3-Clause"
] | null | null | null | # We model a bar 100 nm x 100 nm x 10 nm where a vortex sits in the center.
# This is part II: we load the vortex from file and apply a spin-polarised current
import nmag
from nmag import SI, every, at
# Define the material
mat_Py = nmag.MagMaterial(name="Py",
Ms=SI(0.8e6,"A/m"),
... | 40.827586 | 83 | 0.581926 |
import nmag
from nmag import SI, every, at
mat_Py = nmag.MagMaterial(name="Py",
Ms=SI(0.8e6,"A/m"),
exchange_coupling=SI(13.0e-12, "J/m"),
llg_gamma_G=SI(0.2211e6, "m/A s"),
llg_polarisation=1.0,
... | true | true |
1c11cb1523b34f7decaef526a53d1858e702365c | 285 | py | Python | answers/Shobhit403/DAY 8/Answer2.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | null | null | null | answers/Shobhit403/DAY 8/Answer2.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | null | null | null | answers/Shobhit403/DAY 8/Answer2.py | arc03/30-DaysOfCode-March-2021 | 6d6e11bf70280a578113f163352fa4fa8408baf6 | [
"MIT"
] | null | null | null | class Solution(object):
def arrayPairSum(self, a):
"""
:type nums: List[int]
:rtype: int
"""
n = len(a)
a.sort()
ans = 0
for i in range(0,n,2):
ans += a[i]
return ans
ob1 = Solution()
print(ob1.arrayPairSum([1,4,3,2]))
| 19 | 34 | 0.487719 | class Solution(object):
def arrayPairSum(self, a):
n = len(a)
a.sort()
ans = 0
for i in range(0,n,2):
ans += a[i]
return ans
ob1 = Solution()
print(ob1.arrayPairSum([1,4,3,2]))
| true | true |
1c11cb4f4b918d4636ea0463fdbb3b9198861107 | 11,042 | py | Python | src/widgetastic_patternfly4/chipgroup.py | Mishrasubha/widgetastic.patternfly4 | 78da52759b1b17b4884391dcb8bd865af663722e | [
"Apache-2.0"
] | 3 | 2019-11-16T05:20:54.000Z | 2022-02-22T22:10:35.000Z | src/widgetastic_patternfly4/chipgroup.py | Mishrasubha/widgetastic.patternfly4 | 78da52759b1b17b4884391dcb8bd865af663722e | [
"Apache-2.0"
] | 66 | 2019-07-09T06:43:00.000Z | 2022-03-29T08:52:57.000Z | src/widgetastic_patternfly4/chipgroup.py | Mishrasubha/widgetastic.patternfly4 | 78da52759b1b17b4884391dcb8bd865af663722e | [
"Apache-2.0"
] | 24 | 2019-06-24T08:21:46.000Z | 2022-02-23T02:57:01.000Z | from wait_for import wait_for
from widgetastic.widget import ParametrizedLocator
from widgetastic.widget import ParametrizedView
from widgetastic.widget import Text
from widgetastic.widget import View
from .button import Button
class ChipReadOnlyError(Exception):
def __init__(self, chip, message):
super(... | 29.762803 | 94 | 0.625974 | from wait_for import wait_for
from widgetastic.widget import ParametrizedLocator
from widgetastic.widget import ParametrizedView
from widgetastic.widget import Text
from widgetastic.widget import View
from .button import Button
class ChipReadOnlyError(Exception):
def __init__(self, chip, message):
super(... | true | true |
1c11cd940565d86b2d431b8df60fa7fc01ced0b2 | 8,289 | py | Python | dynamic_model.py | anonymouscodeeee/MBRL4FIN | f7608b54e1a21be5f9e37ab9b249e825b872b35f | [
"MIT"
] | 1 | 2022-02-14T07:39:12.000Z | 2022-02-14T07:39:12.000Z | dynamic_model.py | anonymouscodeeee/MBRL4FIN | f7608b54e1a21be5f9e37ab9b249e825b872b35f | [
"MIT"
] | null | null | null | dynamic_model.py | anonymouscodeeee/MBRL4FIN | f7608b54e1a21be5f9e37ab9b249e825b872b35f | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import math
import copy
from typing import Tuple, Optional, List, Callable
import abc
import random
import matplotlib as mpl
import matplotlib.pyplot as plt
import pathlib
import numpy as np
import sys, os
os.environ["PATH"] = os.environ["PATH"] + ":" + os.path.realpath("./third_par... | 37.337838 | 160 | 0.594402 | import torch
import torch.nn as nn
import math
import copy
from typing import Tuple, Optional, List, Callable
import abc
import random
import matplotlib as mpl
import matplotlib.pyplot as plt
import pathlib
import numpy as np
import sys, os
os.environ["PATH"] = os.environ["PATH"] + ":" + os.path.realpath("./third_par... | true | true |
1c11cdb20a19d1f3f98474dc50f7c05d3f82ede1 | 648 | py | Python | 011-kth_to_last.py | lzit/python-100 | e16bce29a3661b7475c5c6d590f28a840ebea35b | [
"Apache-2.0"
] | 39 | 2020-12-21T01:59:32.000Z | 2022-03-07T10:49:13.000Z | 011-kth_to_last.py | code6levels/python-100 | 75c835596ce264ad47aea15c23b2757ef92beacd | [
"Apache-2.0"
] | 1 | 2020-03-29T08:55:59.000Z | 2020-03-29T08:55:59.000Z | 011-kth_to_last.py | code6levels/python-100 | 75c835596ce264ad47aea15c23b2757ef92beacd | [
"Apache-2.0"
] | 27 | 2020-02-25T03:31:30.000Z | 2020-11-25T02:27:38.000Z | from linked_list import LinkedList
class MyLinkedList(LinkedList):
def kth_to_last_elem(self, k):
if self.head is None:
return None
fast = self.head
slow = self.head
# Give fast a headstart, incrementing it
# once for k = 1, twice for k = 2, etc
for _ ... | 27 | 60 | 0.554012 | from linked_list import LinkedList
class MyLinkedList(LinkedList):
def kth_to_last_elem(self, k):
if self.head is None:
return None
fast = self.head
slow = self.head
for _ in range(k):
fast = fast.next
if fast is Non... | true | true |
1c11cdee0cd1ce57e3a8dbfe5a6ba5bd48968b1b | 2,579 | py | Python | xiaoxiao/xiaoxiao/project.py | belang/blackbean | b9ae990b8f81c14d8ac956b763298b3e53b30b54 | [
"BSD-3-Clause"
] | null | null | null | xiaoxiao/xiaoxiao/project.py | belang/blackbean | b9ae990b8f81c14d8ac956b763298b3e53b30b54 | [
"BSD-3-Clause"
] | null | null | null | xiaoxiao/xiaoxiao/project.py | belang/blackbean | b9ae990b8f81c14d8ac956b763298b3e53b30b54 | [
"BSD-3-Clause"
] | null | null | null | #! $PATH/python
# -*- coding: utf-8 -*-
# file name: project.py
# author: lianghy
# time: Thu Jun 10 14:56:08 2021
""" """
from os.path import isfile, isdir, join
import logging as lg
from tkinter import messagebox as xm
import view as xv
import text as xt
tx = xt.init_text()
class Project(object):
"""docst... | 25.79 | 53 | 0.568825 |
from os.path import isfile, isdir, join
import logging as lg
from tkinter import messagebox as xm
import view as xv
import text as xt
tx = xt.init_text()
class Project(object):
def __init__(self, ac):
self.ac = ac
self._name = ''
self._dir = '.'
self.is_changed = False
@p... | true | true |
1c11ce124940d4101641380bbdc395b45f7862b8 | 3,347 | py | Python | pysnmp/Unisphere-Data-SMDS-CONF.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Unisphere-Data-SMDS-CONF.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Unisphere-Data-SMDS-CONF.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Unisphere-Data-SMDS-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-SMDS-CONF
# Produced by pysmi-0.3.4 at Mon Apr 29 21:25:40 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.... | 107.967742 | 477 | 0.761578 | Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.impo... | true | true |
1c11ceb030fbce90b886abd28cf17cff87709d1c | 14,434 | py | Python | tools/crawl_all.py | tomwhite/covid-19-uk-data | ca22568cea5a67863fe513eb6ad27aaf9ad58f48 | [
"Unlicense"
] | 186 | 2020-03-14T01:29:41.000Z | 2021-11-12T12:03:09.000Z | tools/crawl_all.py | tomwhite/covid-19-uk-data | ca22568cea5a67863fe513eb6ad27aaf9ad58f48 | [
"Unlicense"
] | 66 | 2020-03-14T10:43:06.000Z | 2021-09-02T23:42:44.000Z | tools/crawl_all.py | tomwhite/covid-19-uk-data | ca22568cea5a67863fe513eb6ad27aaf9ad58f48 | [
"Unlicense"
] | 91 | 2020-03-15T11:18:07.000Z | 2020-12-25T01:44:39.000Z | #!/usr/bin/env python
# Crawls all the historical data in one go. This ensures that revisions of old data are accounted for.
import dateparser
import datetime
import json
import math
import numpy as np
import os
import pandas as pd
import requests
import sqlite3
import sys
import xmltodict
from crawl import get_json... | 43.607251 | 197 | 0.662741 |
import dateparser
import datetime
import json
import math
import numpy as np
import os
import pandas as pd
import requests
import sqlite3
import sys
import xmltodict
from crawl import get_json_url
from parsers import (
parse_daily_areas_json,
save_daily_areas,
save_daily_areas_to_sqlite,
)
from util impo... | true | true |
1c11ceccc1c9166fd8db3f7bb110a1d4263463b5 | 4,735 | py | Python | daisy_workflows/image_import/freebsd/translate.py | zoran15/compute-image-tools | 4574cb1e0faab85e98483a508a364ae27dae1fbb | [
"Apache-2.0"
] | 186 | 2017-03-16T04:02:03.000Z | 2022-03-09T15:04:16.000Z | daisy_workflows/image_import/freebsd/translate.py | zoran15/compute-image-tools | 4574cb1e0faab85e98483a508a364ae27dae1fbb | [
"Apache-2.0"
] | 1,454 | 2017-05-10T01:04:13.000Z | 2022-03-30T16:49:02.000Z | daisy_workflows/image_import/freebsd/translate.py | zoran15/compute-image-tools | 4574cb1e0faab85e98483a508a364ae27dae1fbb | [
"Apache-2.0"
] | 143 | 2017-03-11T00:57:16.000Z | 2022-03-15T01:01:28.000Z | #!/usr/bin/env python3
# Copyright 2017 Google 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 required by ... | 27.52907 | 76 | 0.679409 |
import glob
import logging
import os
import subprocess
import utils
rc_conf = '''
ifconfig_re0="DHCP"
sshd_enable="YES"
ifconfig_DEFAULT="SYNCDHCP mtu 1460"
ntpd_sync_on_start="YES"
'''
ntp_conf = '''
server metadata.google.internal iburst
'''
console_settings = '''
console="comconsole,vidconsole"
comconsole_spe... | true | true |
1c11cf956b5d67a2e0fe168261735af2e571781f | 1,109 | py | Python | indico/modules/events/registration/clone_test.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | 1 | 2021-06-11T20:02:10.000Z | 2021-06-11T20:02:10.000Z | indico/modules/events/registration/clone_test.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | indico/modules/events/registration/clone_test.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import pytest
from indico.modules.events.cloning import EventCloner
from indico.modules.events.features.u... | 34.65625 | 95 | 0.788097 |
import pytest
from indico.modules.events.cloning import EventCloner
from indico.modules.events.features.util import set_feature_enabled
pytest_plugins = 'indico.modules.events.registration.testing.fixtures'
@pytest.mark.usefixtures('dummy_reg')
def test_registration_clone(dummy_event, dummy_regform, create_event,... | true | true |
1c11d0d4b97c5adfb3130baa8706bf44f83ea965 | 608 | py | Python | tests/projects/warmane/constant/test_constant_talent.py | Mario-Kart-Felix/hotkeynet-project | 81b218e86ef85d69ea0e639937f765c7218c2686 | [
"MIT"
] | 2 | 2021-07-25T11:26:23.000Z | 2022-02-02T20:03:20.000Z | tests/projects/warmane/constant/test_constant_talent.py | Mario-Kart-Felix/hotkeynet-project | 81b218e86ef85d69ea0e639937f765c7218c2686 | [
"MIT"
] | null | null | null | tests/projects/warmane/constant/test_constant_talent.py | Mario-Kart-Felix/hotkeynet-project | 81b218e86ef85d69ea0e639937f765c7218c2686 | [
"MIT"
] | 2 | 2021-03-04T07:20:30.000Z | 2021-07-25T11:26:25.000Z | # -*- coding: utf-8 -*-
import pytest
from hotkeynet.projects.warmane.constant.talent import Talent
class TestTalent:
def test_value_is_string(self):
assert Talent.dk_pve_blood_tank.name == "dk_pve_blood_tank"
assert isinstance(Talent.dk_pve_blood_tank.value, int)
def test_sortable(self):
... | 21.714286 | 67 | 0.644737 |
import pytest
from hotkeynet.projects.warmane.constant.talent import Talent
class TestTalent:
def test_value_is_string(self):
assert Talent.dk_pve_blood_tank.name == "dk_pve_blood_tank"
assert isinstance(Talent.dk_pve_blood_tank.value, int)
def test_sortable(self):
l = [
... | true | true |
1c11d43501b9ca37b5af8579570e3e27d924e2e7 | 6,082 | py | Python | jvd/capa/extractor.py | L1NNA/JARV1S-Disassembler | 6bc9d9459bd5142406fdda0ed88ba636934c94c6 | [
"Apache-2.0"
] | 7 | 2020-12-19T18:56:23.000Z | 2021-11-21T20:29:58.000Z | jvd/capa/extractor.py | L1NNA/JARV1S-Disassembler | 6bc9d9459bd5142406fdda0ed88ba636934c94c6 | [
"Apache-2.0"
] | 1 | 2020-12-20T07:57:37.000Z | 2020-12-28T18:10:11.000Z | jvd/capa/extractor.py | L1NNA/JARV1S-Ghidra | 84b551b2a1266b6bcb9454aaa01b97b21d7d4d4f | [
"Apache-2.0"
] | 2 | 2020-12-20T11:32:20.000Z | 2021-03-17T15:36:16.000Z | import os
from shutil import unpack_archive
from collections import defaultdict
import jvd.capa.block as e_block
import jvd.capa.file as e_file
import jvd.capa.function as e_func
import jvd.capa.ins as e_ins
from jvd.capa.data import DataUnit
from jvd.utils import download_file, read_gz_js
from jvd.resources import Re... | 31.030612 | 110 | 0.599803 | import os
from shutil import unpack_archive
from collections import defaultdict
import jvd.capa.block as e_block
import jvd.capa.file as e_file
import jvd.capa.function as e_func
import jvd.capa.ins as e_ins
from jvd.capa.data import DataUnit
from jvd.utils import download_file, read_gz_js
from jvd.resources import Re... | true | true |
1c11d494eaeeff62b4571bdbf3de408f06475a76 | 881 | py | Python | ServerComponent/venv/Lib/site-packages/autocorrect/word_count.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | null | null | null | ServerComponent/venv/Lib/site-packages/autocorrect/word_count.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | ServerComponent/venv/Lib/site-packages/autocorrect/word_count.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | 1 | 2020-10-19T14:55:23.000Z | 2020-10-19T14:55:23.000Z | import json
import re
from collections import Counter, OrderedDict
from autocorrect.constants import word_regexes
def get_words(filename, lang, encd):
word_regex = word_regexes[lang]
capitalized_regex = r'(\.|^|<|"|\'|\(|\[|\{)\s*' + word_regexes[lang]
with open(filename, encoding=encd) as file:
... | 33.884615 | 79 | 0.690125 | import json
import re
from collections import Counter, OrderedDict
from autocorrect.constants import word_regexes
def get_words(filename, lang, encd):
word_regex = word_regexes[lang]
capitalized_regex = r'(\.|^|<|"|\'|\(|\[|\{)\s*' + word_regexes[lang]
with open(filename, encoding=encd) as file:
... | true | true |
1c11d4b81380f694df873bee204b84a6be57b594 | 2,307 | py | Python | publish_data.py | jackyjzheng/Zymkey-AWS-Kit | 18a7b313e8ba3eeb0fea0acc1bf85a02d2f74250 | [
"OpenSSL"
] | 2 | 2019-03-05T09:53:29.000Z | 2021-08-17T16:53:30.000Z | publish_data.py | jackyjzheng/Zymkey-AWS-Kit | 18a7b313e8ba3eeb0fea0acc1bf85a02d2f74250 | [
"OpenSSL"
] | 2 | 2018-02-24T06:41:21.000Z | 2018-02-24T06:46:36.000Z | publish_data.py | jackyjzheng/zkSecureAWS | 18a7b313e8ba3eeb0fea0acc1bf85a02d2f74250 | [
"OpenSSL"
] | 2 | 2018-01-20T22:10:04.000Z | 2018-01-20T22:22:44.000Z | import json
import boto3
import hashlib
import binascii
import pycurl
from OpenSSL import SSL
import random
import datetime
import zymkey
def ZK_AWS_Publish(url, post_field, CA_Path, Cert_Path,):
#Setting Curl to use zymkey_ssl engine
c = pycurl.Curl()
c.setopt(c.SSLENGINE, "zymkey_ssl")
c.setopt(c.SSLENGINE_DEFAU... | 37.209677 | 141 | 0.710446 | import json
import boto3
import hashlib
import binascii
import pycurl
from OpenSSL import SSL
import random
import datetime
import zymkey
def ZK_AWS_Publish(url, post_field, CA_Path, Cert_Path,):
c = pycurl.Curl()
c.setopt(c.SSLENGINE, "zymkey_ssl")
c.setopt(c.SSLENGINE_DEFAULT, 1L)
c.setopt(c.SSLVERSION, c.SSLVE... | false | true |
1c11d573f5eb61aab79af3f561cd4172923991b9 | 5,048 | py | Python | GPF/src/classifier.py | seeker1943/GPF | 478e3c121f8ca774b9c6fefcfe1180ab4b7aa918 | [
"MIT"
] | 104 | 2018-11-04T04:47:13.000Z | 2022-02-26T11:52:47.000Z | GPF/src/classifier.py | seeker1943/GPF | 478e3c121f8ca774b9c6fefcfe1180ab4b7aa918 | [
"MIT"
] | 4 | 2019-03-03T01:35:57.000Z | 2021-05-08T13:59:44.000Z | GPF/src/classifier.py | seeker1943/GPF | 478e3c121f8ca774b9c6fefcfe1180ab4b7aa918 | [
"MIT"
] | 25 | 2019-02-01T07:19:18.000Z | 2022-01-25T06:11:29.000Z | #!/usr/bin/env python
# encoding: utf-8
import sys
#指定路径
sys.path.append("../")
import torch
import torch.nn as nn
from tqdm import tqdm
import numpy as np
from sklearn import metrics
from GraphNet.DGCNN import DGCNN
from GraphNet.mlp_dropout import MLPClassifier
from GraphNet.gcn import BatchGCN
from GraphNet.gat i... | 36.57971 | 131 | 0.587758 |
import sys
sys.path.append("../")
import torch
import torch.nn as nn
from tqdm import tqdm
import numpy as np
from sklearn import metrics
from GraphNet.DGCNN import DGCNN
from GraphNet.mlp_dropout import MLPClassifier
from GraphNet.gcn import BatchGCN
from GraphNet.gat import BatchGAT
from GraphNet.pscn import Batch... | true | true |
1c11d593cac20c7f1decdaa0bbef5b86f90f482c | 37,373 | py | Python | app.py | sitaber/pyDM404 | 63e84cc3b82c6b1910846e388954d67f3fb05ade | [
"MIT"
] | 2 | 2022-03-22T21:28:18.000Z | 2022-03-22T21:34:24.000Z | app.py | sitaber/pyDM404 | 63e84cc3b82c6b1910846e388954d67f3fb05ade | [
"MIT"
] | null | null | null | app.py | sitaber/pyDM404 | 63e84cc3b82c6b1910846e388954d67f3fb05ade | [
"MIT"
] | null | null | null | # -----------------------------------------------------------------------------
# pyDM404 - A cross platform Drum Sequencer
# Author: Scott Taber
# File: app.py - Nuts and bolts of application
# Version: 1.2
# Contains all functions and classes for drawing to screen, getting user input
# loading and saving files, start... | 42.277149 | 117 | 0.503519 |
import os
import sys
import json
import numpy as np
import pygame
from pygame.locals import *
import clock as mc
def make_func_rects(start=95):
button_1 = pygame.Rect(start+15, 170, 50, 10)
button_2 = pygame.Rect(start+125,170, 50, 10)
button_3 = pygame.Rect(start+245, 170, 50, 10)
button_4 = pygam... | true | true |
1c11d6f2654d95895442923b8436db296eb23556 | 751 | py | Python | death_functions.py | Kehvarl/roguelike_tutorial_2019 | 425e150c7c0db3ffccd05a2a5d4c7c06eb01dc29 | [
"MIT"
] | 1 | 2020-09-27T23:02:39.000Z | 2020-09-27T23:02:39.000Z | death_functions.py | Kehvarl/roguelike_tutorial_2019 | 425e150c7c0db3ffccd05a2a5d4c7c06eb01dc29 | [
"MIT"
] | null | null | null | death_functions.py | Kehvarl/roguelike_tutorial_2019 | 425e150c7c0db3ffccd05a2a5d4c7c06eb01dc29 | [
"MIT"
] | null | null | null | import tcod as libtcod
from game_messages import Message
from game_states import GameStates
from components.ai import DeadMonster
from render_functions import RenderOrder
def kill_player(player):
player.char = '%'
player.color = libtcod.dark_red
return Message('You died!', libtcod.red), GameStates.PLAYE... | 25.896552 | 93 | 0.745672 | import tcod as libtcod
from game_messages import Message
from game_states import GameStates
from components.ai import DeadMonster
from render_functions import RenderOrder
def kill_player(player):
player.char = '%'
player.color = libtcod.dark_red
return Message('You died!', libtcod.red), GameStates.PLAYE... | true | true |
1c11d712b632741eb28b6089083d5521f764e35e | 2,482 | py | Python | WIN_NtpClientSetting/OS_gathering/files/extracting.py | exastro-playbook-collection/OS-Windows2019 | 79c4f13e75ae1d4380d30f503f04ffb4dcf52ecf | [
"Apache-2.0"
] | null | null | null | WIN_NtpClientSetting/OS_gathering/files/extracting.py | exastro-playbook-collection/OS-Windows2019 | 79c4f13e75ae1d4380d30f503f04ffb4dcf52ecf | [
"Apache-2.0"
] | null | null | null | WIN_NtpClientSetting/OS_gathering/files/extracting.py | exastro-playbook-collection/OS-Windows2019 | 79c4f13e75ae1d4380d30f503f04ffb4dcf52ecf | [
"Apache-2.0"
] | 1 | 2021-09-29T05:39:41.000Z | 2021-09-29T05:39:41.000Z | import re
import json
import sys
import os
args = sys.argv
if (len(args) < 2):
sys.exit(1)
path = args[1]
if(path[-1:] == "/"):
path = path[:-1]
result_filedata_list = []
target_data_list = []
target_data = {}
target_data['key'] = 'HKLM:\\SYSTEM\\CurrentControlSet\\services\W32Time\\TimeProviders\\NtpClient... | 34.957746 | 99 | 0.624093 | import re
import json
import sys
import os
args = sys.argv
if (len(args) < 2):
sys.exit(1)
path = args[1]
if(path[-1:] == "/"):
path = path[:-1]
result_filedata_list = []
target_data_list = []
target_data = {}
target_data['key'] = 'HKLM:\\SYSTEM\\CurrentControlSet\\services\W32Time\\TimeProviders\\NtpClient... | true | true |
1c11d9894ed3d199285d629e4bbd4ca5c28657ca | 446 | py | Python | tests/test_q5.py | srmnitc/SteinhardtTools | b73865bbc35e88773126a952be653e382e5fbf3c | [
"BSD-3-Clause"
] | 22 | 2019-10-17T13:21:19.000Z | 2021-07-06T12:11:21.000Z | tests/test_q5.py | srmnitc/SteinhardtTools | b73865bbc35e88773126a952be653e382e5fbf3c | [
"BSD-3-Clause"
] | 68 | 2019-09-07T22:28:06.000Z | 2021-10-17T15:24:23.000Z | tests/test_q5.py | srmnitc/SteinhardtTools | b73865bbc35e88773126a952be653e382e5fbf3c | [
"BSD-3-Clause"
] | 10 | 2019-11-01T20:29:07.000Z | 2021-10-04T19:09:29.000Z | import pytest
import os
import numpy as np
import pyscal.core as pc
import pyscal.crystal_structures as pcs
def test_q_5():
atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
sys = pc.System()
sys.box = boxdims
sys.atoms = atoms
sys.find_neighbors(method = 'voronoi')
sys.calcul... | 24.777778 | 69 | 0.681614 | import pytest
import os
import numpy as np
import pyscal.core as pc
import pyscal.crystal_structures as pcs
def test_q_5():
atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
sys = pc.System()
sys.box = boxdims
sys.atoms = atoms
sys.find_neighbors(method = 'voronoi')
sys.calcul... | true | true |
1c11da84b35eb92835c00ce443ac061934f15c04 | 2,203 | py | Python | src/bin/colorset_hexvals.py | dklopfenstein/biocode | 1960a276279b3b7667ae37264b56252f0d2562ee | [
"MIT"
] | null | null | null | src/bin/colorset_hexvals.py | dklopfenstein/biocode | 1960a276279b3b7667ae37264b56252f0d2562ee | [
"MIT"
] | null | null | null | src/bin/colorset_hexvals.py | dklopfenstein/biocode | 1960a276279b3b7667ae37264b56252f0d2562ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Example using MplColorHelper."""
# Copyright (C) 2014-2017 DV Klopfenstein. All rights reserved.
__author__ = 'DV Klopfenstein'
__copyright__ = "Copyright (C) 2014-2017 DV Klopfenstein. All rights reserved."
__license__ = "GPL"
import sys
import matplotlib
matplotlib.use('Agg')
import matpl... | 30.178082 | 92 | 0.649115 |
__author__ = 'DV Klopfenstein'
__copyright__ = "Copyright (C) 2014-2017 DV Klopfenstein. All rights reserved."
__license__ = "GPL"
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from pydvkbiology.matplotlib.ColorObj import MplColorHelper
import numpy as np
def run(palette='hsv',... | true | true |
1c11db5b4f357e0abf92c97d09d0b88c4b822608 | 1,008 | py | Python | My_algorithms/Logistic_Regression/DataPreprocessing.py | MageshDominator/data-science-py | 6dd98a16e72bda96cf5fa3db01c044e3f1b66c05 | [
"MIT"
] | 1 | 2019-02-09T16:03:20.000Z | 2019-02-09T16:03:20.000Z | My_algorithms/Logistic_Regression/DataPreprocessing.py | MageshDominator/data-science-py | 6dd98a16e72bda96cf5fa3db01c044e3f1b66c05 | [
"MIT"
] | null | null | null | My_algorithms/Logistic_Regression/DataPreprocessing.py | MageshDominator/data-science-py | 6dd98a16e72bda96cf5fa3db01c044e3f1b66c05 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 4 21:04:05 2019
@author: MAGESHWARAN
"""
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from LogReg import LogRegWithRegularization
data = pd.read_csv("ex2data2.csv", sep = ",")
# p... | 22.4 | 93 | 0.707341 |
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from LogReg import LogRegWithRegularization
data = pd.read_csv("ex2data2.csv", sep = ",")
m = data.shape[0]
n = data.shape[1] - 1
X = np.zeros((m, n + 1))
y = np.array((m, 1))
X[:... | true | true |
1c11db6f496a5b72c1636a89d919ae35a902e4d2 | 10,686 | py | Python | thoipapy/figs/create_BOcurve_files.py | bojigu/thoipapy | cc571677bd7e25e73db07af9d5d3c2cc36682903 | [
"MIT"
] | 2 | 2018-04-06T15:59:52.000Z | 2019-01-19T06:14:22.000Z | thoipapy/figs/create_BOcurve_files.py | bojigu/thoipapy | cc571677bd7e25e73db07af9d5d3c2cc36682903 | [
"MIT"
] | 17 | 2018-06-20T14:41:39.000Z | 2022-03-12T00:50:25.000Z | thoipapy/figs/create_BOcurve_files.py | bojigu/thoipapy | cc571677bd7e25e73db07af9d5d3c2cc36682903 | [
"MIT"
] | null | null | null | import warnings
from pathlib import Path
from typing import Union
warnings.simplefilter(action='ignore', category=FutureWarning)
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
import warnings
from scipy.stats import linregress
from thoipapy.utils import normalise_0_1, make_sure_path_e... | 49.702326 | 161 | 0.561389 | import warnings
from pathlib import Path
from typing import Union
warnings.simplefilter(action='ignore', category=FutureWarning)
import pandas as pd
import os
import numpy as np
import matplotlib.pyplot as plt
import warnings
from scipy.stats import linregress
from thoipapy.utils import normalise_0_1, make_sure_path_e... | true | true |
1c11dc6a8ef19c6cb8f1be30fe55e4b699a40312 | 86 | py | Python | bmonreporter/__init__.py | alanmitchell/bmonreporter | caa0f4fe3288c6ccc1b185d42cbb60e1979fcdf8 | [
"Apache-2.0"
] | null | null | null | bmonreporter/__init__.py | alanmitchell/bmonreporter | caa0f4fe3288c6ccc1b185d42cbb60e1979fcdf8 | [
"Apache-2.0"
] | null | null | null | bmonreporter/__init__.py | alanmitchell/bmonreporter | caa0f4fe3288c6ccc1b185d42cbb60e1979fcdf8 | [
"Apache-2.0"
] | null | null | null | # Version for the bmon-reporter package
__version__ = "1.0.2"
from . import reporter
| 17.2 | 39 | 0.744186 | __version__ = "1.0.2"
from . import reporter
| true | true |
1c11dc9494f34e6b645a8bd6dbcc5d35ec4cf7ff | 4,379 | py | Python | account/tests.py | JeekStudio/StudentPlatform | d2cccef6555a7c9d137ecab54dbbd4aa219be57b | [
"MIT"
] | 4 | 2019-02-23T13:34:48.000Z | 2019-04-09T12:44:19.000Z | account/tests.py | JeekStudio/StudentPlatform | d2cccef6555a7c9d137ecab54dbbd4aa219be57b | [
"MIT"
] | 134 | 2019-01-29T03:49:54.000Z | 2021-04-08T18:44:57.000Z | account/tests.py | JeekStudio/StudentPlatform | d2cccef6555a7c9d137ecab54dbbd4aa219be57b | [
"MIT"
] | null | null | null | from rest_framework.test import APIClient
from testing.testcases import TestCase
# Create your tests here.
class AccountTests(TestCase):
def setUp(self):
self.user = self.createUser('ncjxjj')
def test_login(self):
url = '/api/account/login/'
data = {
'username': 'ncjxjj'... | 34.210938 | 76 | 0.628682 | from rest_framework.test import APIClient
from testing.testcases import TestCase
class AccountTests(TestCase):
def setUp(self):
self.user = self.createUser('ncjxjj')
def test_login(self):
url = '/api/account/login/'
data = {
'username': 'ncjxjj',
'password': ... | true | true |
1c11dc94f130a2807798806bad63a6da530e4ff6 | 8,438 | py | Python | cobl/lexicon/management/commands/stats236.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | null | null | null | cobl/lexicon/management/commands/stats236.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | null | null | null | cobl/lexicon/management/commands/stats236.py | Bibiko/CoBL-public | 5092a0d01b7a13565c7da6bf2f6c52d648a2debe | [
"BSD-2-Clause"
] | 1 | 2020-04-30T11:02:51.000Z | 2020-04-30T11:02:51.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management import BaseCommand
from cobl.lexicon.models import LanguageList, \
MeaningList, \
Meaning, \
Lexeme, \
... | 48.494253 | 79 | 0.508059 | from __future__ import unicode_literals
from django.core.management import BaseCommand
from cobl.lexicon.models import LanguageList, \
MeaningList, \
Meaning, \
Lexeme, \
CognateClass, \... | true | true |
1c11dcdee799b0b1f24cafbcff31abb16a71efb5 | 405 | py | Python | CapitanAmerica/asgi.py | SteveenDominguez/CapitanAmerica | ba7dac521c6412b652a1aea3ec9f5cf9ad73bd7c | [
"Apache-2.0"
] | 1 | 2020-05-12T22:52:35.000Z | 2020-05-12T22:52:35.000Z | CapitanAmerica/asgi.py | SteveenDominguez/CapitanAmerica | ba7dac521c6412b652a1aea3ec9f5cf9ad73bd7c | [
"Apache-2.0"
] | 2 | 2020-05-12T13:24:27.000Z | 2020-05-13T07:23:21.000Z | CapitanAmerica/asgi.py | SteveenDominguez/CapitanAmerica | ba7dac521c6412b652a1aea3ec9f5cf9ad73bd7c | [
"Apache-2.0"
] | 1 | 2020-05-12T22:05:51.000Z | 2020-05-12T22:05:51.000Z | """
ASGI config for CapitanAmerica project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CapitanAmerica.settings')
application = get_asgi_application()
| true | true |
1c11dce83ff1ffedc2456372f83992ce0b80bf7b | 15,691 | py | Python | Tests/test_HMMGeneral.py | eric-erki/biopython | 2b4f7474766427c4ff4bf01e66b436f23456208e | [
"BSD-3-Clause"
] | null | null | null | Tests/test_HMMGeneral.py | eric-erki/biopython | 2b4f7474766427c4ff4bf01e66b436f23456208e | [
"BSD-3-Clause"
] | 1 | 2019-02-24T18:24:56.000Z | 2019-02-27T02:31:56.000Z | Tests/test_HMMGeneral.py | eric-erki/biopython | 2b4f7474766427c4ff4bf01e66b436f23456208e | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2001 Brad Chapman. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Test the HMM.MarkovModel ... | 36.92 | 87 | 0.618699 |
import unittest
import math
from Bio.Seq import Seq
from Bio.HMM import MarkovModel
from Bio.HMM import DynamicProgramming
from Bio.HMM import Trainer
number_alphabet = ("1", "2") letter_alphabet = ("A", "B")
class TrainingSequenceTest(unittest.TestCase):
def test_empty_state_training_sequence(self):
... | true | true |
1c11dd2e3d79d316ffe72e7b7249e71f2e83be9a | 11,419 | py | Python | distributed/process.py | bnavigator/distributed | 5ea74cd7ec3cf5b90c5e6d5a31fb7dc3888ea242 | [
"BSD-3-Clause"
] | 1 | 2021-09-22T04:10:32.000Z | 2021-09-22T04:10:32.000Z | distributed/process.py | bnavigator/distributed | 5ea74cd7ec3cf5b90c5e6d5a31fb7dc3888ea242 | [
"BSD-3-Clause"
] | 1 | 2021-01-25T09:48:56.000Z | 2021-01-25T09:48:56.000Z | distributed/process.py | bnavigator/distributed | 5ea74cd7ec3cf5b90c5e6d5a31fb7dc3888ea242 | [
"BSD-3-Clause"
] | 1 | 2021-01-10T10:35:25.000Z | 2021-01-10T10:35:25.000Z | import logging
import os
from queue import Queue as PyQueue
import re
import threading
import weakref
import asyncio
import dask
from .utils import mp_context, TimeoutError
from tornado import gen
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
logger = logging.getLogger(__name__)
def _loo... | 33.098551 | 87 | 0.59979 | import logging
import os
from queue import Queue as PyQueue
import re
import threading
import weakref
import asyncio
import dask
from .utils import mp_context, TimeoutError
from tornado import gen
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
logger = logging.getLogger(__name__)
def _loo... | true | true |
1c11ddb4f1cdca67fb948a22a542fd5c5f68dfd2 | 7,772 | py | Python | py/conftest.py | jackall3n/selenium | 9a33a3273cedf6865326fc2cafa61349cf36cd7b | [
"Apache-2.0"
] | 1 | 2021-06-19T23:05:23.000Z | 2021-06-19T23:05:23.000Z | py/conftest.py | jackall3n/selenium | 9a33a3273cedf6865326fc2cafa61349cf36cd7b | [
"Apache-2.0"
] | null | null | null | py/conftest.py | jackall3n/selenium | 9a33a3273cedf6865326fc2cafa61349cf36cd7b | [
"Apache-2.0"
] | 1 | 2020-06-25T20:03:35.000Z | 2020-06-25T20:03:35.000Z | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 33.791304 | 105 | 0.654529 |
import os
import socket
import subprocess
import sys
import time
import pytest
from _pytest.skipping import MarkEvaluator
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
from test.selenium.webdriver.common.webserver import SimpleWebServer
from test.selenium.webdriver.common.network ... | true | true |
1c11de1dd5544a48fe7639e37943fd84a53d54fa | 362 | py | Python | larq/__init__.py | inventor71/larq | 882740fb455fbab6f36bc79f0de9a49f5d9ed481 | [
"Apache-2.0"
] | null | null | null | larq/__init__.py | inventor71/larq | 882740fb455fbab6f36bc79f0de9a49f5d9ed481 | [
"Apache-2.0"
] | null | null | null | larq/__init__.py | inventor71/larq | 882740fb455fbab6f36bc79f0de9a49f5d9ed481 | [
"Apache-2.0"
] | null | null | null | from larq import (
activations,
callbacks,
constraints,
context,
layers,
math,
metrics,
models,
optimizers,
quantizers,
utils,
)
__all__ = [
"layers",
"activations",
"callbacks",
"constraints",
"context",
"math",
"metrics",
"models",
"quan... | 12.928571 | 18 | 0.533149 | from larq import (
activations,
callbacks,
constraints,
context,
layers,
math,
metrics,
models,
optimizers,
quantizers,
utils,
)
__all__ = [
"layers",
"activations",
"callbacks",
"constraints",
"context",
"math",
"metrics",
"models",
"quan... | true | true |
1c11de729cd96a479ad0f15e6fe797c7838bfeea | 19,267 | py | Python | Lib/fontTools/ttLib/sfnt.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 240 | 2021-01-11T14:49:24.000Z | 2022-03-29T22:33:49.000Z | Lib/fontTools/ttLib/sfnt.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 77 | 2021-01-12T20:23:30.000Z | 2022-03-28T12:14:34.000Z | Lib/fontTools/ttLib/sfnt.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 28 | 2021-01-17T05:44:11.000Z | 2022-01-11T19:58:46.000Z | """ttLib/sfnt.py -- low-level module to deal with the sfnt file format.
Defines two public classes:
SFNTReader
SFNTWriter
(Normally you don't have to use these classes explicitly; they are
used automatically by ttLib.TTFont.)
The reading and writing of sfnt files is separated in two distinct
classes, since wheneve... | 30.876603 | 114 | 0.705714 |
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.ttLib import TTLibError
import struct
from collections import OrderedDict
import logging
log = logging.getLogger(__name__)
class SFNTReader(object):
def __new__(cls... | true | true |
1c11de8dc74d54e8d8fbf236d4b2fbef4f879e5a | 582 | py | Python | python2.7/site-packages/twisted/words/scripts/im.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | python2.7/site-packages/twisted/words/scripts/im.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | python2.7/site-packages/twisted/words/scripts/im.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
import os
def run():
if os.name == 'java':
from twisted.internet import javareactor
javareactor.install()
from twisted.words.im.jyaccount import AccountManagementGUI
AccountManagementGUI()
else:
... | 25.304348 | 67 | 0.682131 |
import os
def run():
if os.name == 'java':
from twisted.internet import javareactor
javareactor.install()
from twisted.words.im.jyaccount import AccountManagementGUI
AccountManagementGUI()
else:
from twisted.internet import gtkreactor
gtkreactor.install()
... | true | true |
1c11ded05a83fcaa917fa65a064acefbccad1cb8 | 5,418 | py | Python | test/TestRunner.py | eahlstrom/ansible-lint | abc946f378a3690a4cb06eb9a7e9d60fb46fb35d | [
"MIT"
] | null | null | null | test/TestRunner.py | eahlstrom/ansible-lint | abc946f378a3690a4cb06eb9a7e9d60fb46fb35d | [
"MIT"
] | null | null | null | test/TestRunner.py | eahlstrom/ansible-lint | abc946f378a3690a4cb06eb9a7e9d60fb46fb35d | [
"MIT"
] | null | null | null | # Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
#
# 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... | 39.26087 | 80 | 0.662975 |
import os
import unittest
import ansiblelint
from ansiblelint import default_rulesdir, Runner, RulesCollection
import ansiblelint.formatters
class TestRule(unittest.TestCase):
def setUp(self):
rulesdir = os.path.join('lib', 'ansiblelint', 'rules')
self.rules = RulesCollection([rulesdir])
d... | true | true |
1c11df93f0f4293086cae4b8f1babfdf4f72ad51 | 5,865 | py | Python | mvpa_itab/script/carlo/pattern_connectivity.py | robbisg/mvpa_itab_wu | e3cdb198a21349672f601cd34381e0895fa6484c | [
"MIT"
] | 1 | 2022-01-12T08:59:22.000Z | 2022-01-12T08:59:22.000Z | mvpa_itab/script/carlo/pattern_connectivity.py | robbisg/mvpa_itab_wu | e3cdb198a21349672f601cd34381e0895fa6484c | [
"MIT"
] | 46 | 2016-08-04T14:49:37.000Z | 2022-03-09T08:47:48.000Z | mvpa_itab/script/carlo/pattern_connectivity.py | robbisg/mvpa_itab_wu | e3cdb198a21349672f601cd34381e0895fa6484c | [
"MIT"
] | null | null | null | from mvpa_itab.similarity.connectivity import pattern_connectivity,\
subject_pattern_connectivity
from mvpa_itab.pipeline.deprecated.searchlight import LeaveOneSubjectOutSL
import nibabel as ni
from scipy.stats.stats import zscore
from mvpa_itab.similarity.trajectory import get_speed_timecourse,\
partial_correl... | 35.11976 | 125 | 0.679454 | from mvpa_itab.similarity.connectivity import pattern_connectivity,\
subject_pattern_connectivity
from mvpa_itab.pipeline.deprecated.searchlight import LeaveOneSubjectOutSL
import nibabel as ni
from scipy.stats.stats import zscore
from mvpa_itab.similarity.trajectory import get_speed_timecourse,\
partial_correl... | true | true |
1c11e0195b8d460521797fdd53258cea42dfda48 | 726 | py | Python | leds.py | squareturn/hwsup | 69b4a93201fa8ae3a05b496273c7fdb2442c5b64 | [
"Apache-2.0"
] | null | null | null | leds.py | squareturn/hwsup | 69b4a93201fa8ae3a05b496273c7fdb2442c5b64 | [
"Apache-2.0"
] | 1 | 2016-11-17T21:31:50.000Z | 2016-11-17T21:31:50.000Z | leds.py | squareturn/hwsup | 69b4a93201fa8ae3a05b496273c7fdb2442c5b64 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import RPi.GPIO as GPIO
import sys
LED_RED = 7 # 3 color led on POE HAT
LED_GREEN = 22 # 3 color led on POE HAT
LED_BLUE = 9 # 3 color led on POE HAT
LED_RJ45 = 25 # second green led on rj45 connector
def initialize():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_RED, GP... | 20.742857 | 52 | 0.674931 |
import RPi.GPIO as GPIO
import sys
LED_RED = 7 LED_GREEN = 22 LED_BLUE = 9 LED_RJ45 = 25
def initialize():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_RED, GPIO.OUT)
GPIO.setup(LED_GREEN, GPIO.OUT)
GPIO.setup(LED_BLUE, GPIO.OUT)
GPIO.setup(LED_RJ45, GPIO.OUT)
def led(value):
GPIO.ou... | true | true |
1c11e17700eed200893c870045b4132f302d7629 | 53,795 | gyp | Python | packages/grpc-native-core/binding.gyp | sangaman/grpc-node | 7e49054e51faecb32d4f1ff41c4f100841dd176a | [
"Apache-2.0"
] | null | null | null | packages/grpc-native-core/binding.gyp | sangaman/grpc-node | 7e49054e51faecb32d4f1ff41c4f100841dd176a | [
"Apache-2.0"
] | null | null | null | packages/grpc-native-core/binding.gyp | sangaman/grpc-node | 7e49054e51faecb32d4f1ff41c4f100841dd176a | [
"Apache-2.0"
] | null | null | null | # GRPC Node gyp file
# This currently builds the Node extension and dependencies
# This file has been automatically generated from a template file.
# Please look at the templates directory instead.
# This file can be regenerated from the template by running
# tools/buildgen/generate_projects.sh
# Copyright 2015 gRPC a... | 53.157115 | 192 | 0.650469 |
{
'variables': {
'runtime%': 'node',
'grpc_alpn%': 'true',
'grpc_gcov%': 'false',
'grpc_alpine%': 'false'
},
'target_defaults': {
'configurations': {
'Release': {
'cflags': [
'-O2',
'-Wframe-larger-than=16384',
],
... | true | true |
1c11e18b7ab1fef22ae2d6e6b4cec64dabb42d8a | 1,420 | py | Python | alarm_clock/app.py | themason45/covclock | 93cd3c66df178985a586545d125c552c778ee480 | [
"MIT"
] | null | null | null | alarm_clock/app.py | themason45/covclock | 93cd3c66df178985a586545d125c552c778ee480 | [
"MIT"
] | null | null | null | alarm_clock/app.py | themason45/covclock | 93cd3c66df178985a586545d125c552c778ee480 | [
"MIT"
] | null | null | null | """
The main application startup code.
Run with:
python app.py
Written By: Sam Mason
Date: Nov 2020
"""
import logging
import os
from dotenv import load_dotenv
from flask import Flask
from alarm_clock.support import format_datetime, context_vars, context_funcs
from alarm_clock.views import create_alarm, delete_... | 28.979592 | 97 | 0.761972 | import logging
import os
from dotenv import load_dotenv
from flask import Flask
from alarm_clock.support import format_datetime, context_vars, context_funcs
from alarm_clock.views import create_alarm, delete_alarm, index, \
run_scheduler, alarm_post, delete_notification
load_dotenv(dotenv_path='../.env')
app = ... | true | true |
1c11e1be0844e265ba5db8c9c7d97f54cc9cdaa4 | 579 | py | Python | whispers/plugins/javascript.py | nidogski/whispers | 5832bf74dcb127128ba653ed87601c927124b5aa | [
"Apache-2.0"
] | 415 | 2020-04-27T11:35:02.000Z | 2022-03-24T00:10:49.000Z | whispers/plugins/javascript.py | Karmaz95/whispers | 23cb8eafed4d577d03d21b494e639642f5f17f49 | [
"Apache-2.0"
] | 28 | 2020-12-09T15:30:55.000Z | 2022-03-28T09:08:04.000Z | whispers/plugins/javascript.py | Karmaz95/whispers | 23cb8eafed4d577d03d21b494e639642f5f17f49 | [
"Apache-2.0"
] | 49 | 2020-04-28T02:22:54.000Z | 2022-01-26T07:37:05.000Z | from pathlib import Path
from whispers.utils import string_is_function, string_is_quoted, strip_string
class Javascript:
def pairs(self, filepath: Path):
for line in filepath.open("r").readlines():
if line.count("=") == 1:
yield from self.parse_assignment(line)
def parse_... | 32.166667 | 77 | 0.626943 | from pathlib import Path
from whispers.utils import string_is_function, string_is_quoted, strip_string
class Javascript:
def pairs(self, filepath: Path):
for line in filepath.open("r").readlines():
if line.count("=") == 1:
yield from self.parse_assignment(line)
def parse_... | true | true |
1c11e27afdbc3b1fdc677468da9c299a9280c247 | 2,402 | py | Python | gluetool_modules_framework/tests/test_brew_build_task_params.py | testing-farm/gluetool-modules | bc3b39ae0d3150d2857b2c4cd5453fe492ea7ed0 | [
"Apache-2.0"
] | null | null | null | gluetool_modules_framework/tests/test_brew_build_task_params.py | testing-farm/gluetool-modules | bc3b39ae0d3150d2857b2c4cd5453fe492ea7ed0 | [
"Apache-2.0"
] | null | null | null | gluetool_modules_framework/tests/test_brew_build_task_params.py | testing-farm/gluetool-modules | bc3b39ae0d3150d2857b2c4cd5453fe492ea7ed0 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import pytest
from mock import MagicMock
import gluetool_modules_framework.helpers.brew_build_task_params
from . import create_module, patch_shared, check_loadable
def _patched_module(module, monkeypatch, scratch=False):
... | 30.794872 | 115 | 0.754371 |
import pytest
from mock import MagicMock
import gluetool_modules_framework.helpers.brew_build_task_params
from . import create_module, patch_shared, check_loadable
def _patched_module(module, monkeypatch, scratch=False):
mock_task = MagicMock()
mock_task.scratch = scratch
mock_task.build_id = 'foo-buil... | true | true |
1c11e2b8e8768d8f806682e216f965533a0463b0 | 659 | py | Python | problems/pythonlists/submissions/accepted/stefan.py | stoman/CompetitiveProgramming | 0000b64369b50e31c6f48939e837bdf6cece8ce4 | [
"MIT"
] | 2 | 2020-12-22T13:21:25.000Z | 2021-12-12T22:26:26.000Z | problems/pythonlists/submissions/accepted/stefan.py | stoman/CompetitiveProgramming | 0000b64369b50e31c6f48939e837bdf6cece8ce4 | [
"MIT"
] | null | null | null | problems/pythonlists/submissions/accepted/stefan.py | stoman/CompetitiveProgramming | 0000b64369b50e31c6f48939e837bdf6cece8ce4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#Author: Stefan Toman
if __name__ == '__main__':
n = int(input())
list = []
for i in range(n):
command = str.split(input())
if command[0] == "insert":
list.insert(int(command[1]), int(command[2]))
elif command[0] == "print":
print(list... | 27.458333 | 57 | 0.491654 |
if __name__ == '__main__':
n = int(input())
list = []
for i in range(n):
command = str.split(input())
if command[0] == "insert":
list.insert(int(command[1]), int(command[2]))
elif command[0] == "print":
print(list)
elif command[0] == "remove":
... | true | true |
1c11e2d4584ffa95f81448e97392875e376a8b06 | 2,237 | py | Python | bob/db/braccent/models.py | natharb/bob.db.braccent | ff8f651f7ef47f7e4fd78c1c780c19e993be9fb6 | [
"BSD-3-Clause"
] | null | null | null | bob/db/braccent/models.py | natharb/bob.db.braccent | ff8f651f7ef47f7e4fd78c1c780c19e993be9fb6 | [
"BSD-3-Clause"
] | null | null | null | bob/db/braccent/models.py | natharb/bob.db.braccent | ff8f651f7ef47f7e4fd78c1c780c19e993be9fb6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Nathália Alves Rocha Batista
"""
Table models and functionality for the BRACCENT DATABASE
"""
import sqlalchemy
from sqlalchemy import Table, Column, Integer, String, Boolean, ForeignKey, or_, and_, not_
from bob.db.base.sqlalchemy_migration import Enu... | 30.22973 | 293 | 0.703174 |
import sqlalchemy
from sqlalchemy import Table, Column, Integer, String, Boolean, ForeignKey, or_, and_, not_
from bob.db.base.sqlalchemy_migration import Enum, relationship
from sqlalchemy.orm import backref
from sqlalchemy.ext.declarative import declarative_base
import bob.db.base
import os
Base = declarative_ba... | true | true |
1c11e2d5be6fb60d477e3c16f1607988089bb87b | 1,704 | py | Python | interpreter/src/virtual_machine/vm/io_ops.py | Cdayz/simple_lang | dc19d6ef76bb69c87981c8b826cf8f71b0cc475b | [
"MIT"
] | 3 | 2019-08-22T01:20:16.000Z | 2021-02-05T09:11:50.000Z | interpreter/src/virtual_machine/vm/io_ops.py | Cdayz/simple_lang | dc19d6ef76bb69c87981c8b826cf8f71b0cc475b | [
"MIT"
] | null | null | null | interpreter/src/virtual_machine/vm/io_ops.py | Cdayz/simple_lang | dc19d6ef76bb69c87981c8b826cf8f71b0cc475b | [
"MIT"
] | 2 | 2019-08-22T01:20:18.000Z | 2021-05-27T14:40:12.000Z | """Module with IO operations for VmState execution."""
from interpreter.src.virtual_machine.vm.vm_def import (
VmState,
VM_OPERATION_TO_BYTECODE
)
from interpreter.src.virtual_machine.vm.helpers import vm_operation
@vm_operation
def vm_input(vm_state: VmState, *args, op_bytecode=None, **kwargs) -> VmState:
... | 27.934426 | 78 | 0.673709 |
from interpreter.src.virtual_machine.vm.vm_def import (
VmState,
VM_OPERATION_TO_BYTECODE
)
from interpreter.src.virtual_machine.vm.helpers import vm_operation
@vm_operation
def vm_input(vm_state: VmState, *args, op_bytecode=None, **kwargs) -> VmState:
op_code, arg1_type, arg1, _, _ = op_bytecode
as... | true | true |
1c11e306323920b6217ff06dabf40d6a876ebf62 | 393 | py | Python | locallib/wsgi.py | DIAMONDinc/django_locallib | bb1365b11668f41690d3b505c0129631cc117511 | [
"MIT"
] | null | null | null | locallib/wsgi.py | DIAMONDinc/django_locallib | bb1365b11668f41690d3b505c0129631cc117511 | [
"MIT"
] | null | null | null | locallib/wsgi.py | DIAMONDinc/django_locallib | bb1365b11668f41690d3b505c0129631cc117511 | [
"MIT"
] | null | null | null | """
WSGI config for locallib 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/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "locallib.settings")
application = get_wsgi_application()
| true | true |
1c11e49f47c07d2252b16acb76acc621a2cd2982 | 496 | py | Python | Lib/site-packages/plotly/validators/scattermapbox/_ids.py | tytanya/my-first-blog | 2b40adb0816c3546e90ad6ca1e7fb50d924c1536 | [
"bzip2-1.0.6"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/scattermapbox/_ids.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2021-03-18T22:27:08.000Z | 2022-03-11T23:40:50.000Z | plotly/validators/scattermapbox/_ids.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name='ids', parent_name='scattermapbox', **kwargs
):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | 29.176471 | 70 | 0.616935 | import _plotly_utils.basevalidators
class IdsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name='ids', parent_name='scattermapbox', **kwargs
):
super(IdsValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name... | true | true |
1c11e6ddbf1d392d91b2cdd1717cb7cbd4325112 | 1,773 | py | Python | cartesio/core/jit_compile.py | cdeldon/cartesio | a07d378b4752f7050d9194778863e27089220a67 | [
"MIT"
] | null | null | null | cartesio/core/jit_compile.py | cdeldon/cartesio | a07d378b4752f7050d9194778863e27089220a67 | [
"MIT"
] | 12 | 2020-07-08T22:12:11.000Z | 2022-02-07T08:02:36.000Z | cartesio/core/jit_compile.py | cdeldon/cartesio | a07d378b4752f7050d9194778863e27089220a67 | [
"MIT"
] | 1 | 2020-07-06T08:53:48.000Z | 2020-07-06T08:53:48.000Z | import os
import warnings
from functools import wraps
__all__ = [
"jit_compile",
]
ENV_CARTESIO_DISABLE_JIT_COMPILE = "CARTESIO_DISABLE_JIT_COMPILE"
DISABLE_JIT_COMPILE = os.getenv(ENV_CARTESIO_DISABLE_JIT_COMPILE, "FALSE").upper() in {
"TRUE",
"YES",
"1",
}
_numba_jit_compile = False
if not DISABLE_... | 26.073529 | 87 | 0.608009 | import os
import warnings
from functools import wraps
__all__ = [
"jit_compile",
]
ENV_CARTESIO_DISABLE_JIT_COMPILE = "CARTESIO_DISABLE_JIT_COMPILE"
DISABLE_JIT_COMPILE = os.getenv(ENV_CARTESIO_DISABLE_JIT_COMPILE, "FALSE").upper() in {
"TRUE",
"YES",
"1",
}
_numba_jit_compile = False
if not DISABLE_... | true | true |
1c11e7641ebba152c4f8fdc9731c287a268a0522 | 1,526 | py | Python | api/python/test/test_activity_type.py | Fl3x0r/StravAPP | 17a12f8a6c78914cc380ce3d9300487e26a536ac | [
"MIT"
] | null | null | null | api/python/test/test_activity_type.py | Fl3x0r/StravAPP | 17a12f8a6c78914cc380ce3d9300487e26a536ac | [
"MIT"
] | 1 | 2021-09-09T14:04:55.000Z | 2021-09-10T17:58:37.000Z | custom-swagger/python/test/test_activity_type.py | Zepp333333/HARDIO | 9a36e8fd9c9478f98dbe929e5a31e4e87fdc1932 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Strava API v3
The [Swagger Playground](https://developers.strava.com/playground) is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with differe... | 37.219512 | 726 | 0.743119 |
from __future__ import absolute_import
import unittest
import swagger_client
from swagger_client.models.activity_type import ActivityType from swagger_client.rest import ApiException
class TestActivityType(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test... | true | true |
1c11e76c10349b3610dcbf5678a1b96e0370d130 | 908 | py | Python | migrations/versions/2356a38169ea_followers.py | kevinbowen777/flask_demo | f7637a0daea17ea13964c99a06e153f5802865d0 | [
"MIT"
] | null | null | null | migrations/versions/2356a38169ea_followers.py | kevinbowen777/flask_demo | f7637a0daea17ea13964c99a06e153f5802865d0 | [
"MIT"
] | 1 | 2022-03-01T04:23:09.000Z | 2022-03-01T04:23:09.000Z | migrations/versions/2356a38169ea_followers.py | kevinbowen777/flask_chat | f7637a0daea17ea13964c99a06e153f5802865d0 | [
"MIT"
] | null | null | null | """followers
Revision ID: 2356a38169ea
Revises: 288cd3dc5a8
Create Date: 2013-12-31 16:10:34.500006
"""
# revision identifiers, used by Alembic.
revision = '2356a38169ea'
down_revision = '288cd3dc5a8'
import sqlalchemy as sa
from alembic import op
def upgrade():
### commands auto generated by Alembic - please... | 26.705882 | 63 | 0.683921 |
revision = '2356a38169ea'
down_revision = '288cd3dc5a8'
import sqlalchemy as sa
from alembic import op
def upgrade():
op.create_table('follows',
sa.Column('follower_id', sa.Integer(), nullable=False),
sa.Column('followed_id', sa.Integer(), nullable=False),
sa.Column('timestamp', sa.DateTime(), n... | true | true |
1c11e7b9dc8c344d184b8778617b355dd3db9f20 | 6,777 | py | Python | concierge/constants.py | victusfate/concierge | 9fa7e27a879f478b478f6deaf03255b48c1630e9 | [
"MIT"
] | 14 | 2021-12-16T06:56:08.000Z | 2022-03-30T11:59:50.000Z | concierge/constants.py | victusfate/concierge | 9fa7e27a879f478b478f6deaf03255b48c1630e9 | [
"MIT"
] | null | null | null | concierge/constants.py | victusfate/concierge | 9fa7e27a879f478b478f6deaf03255b48c1630e9 | [
"MIT"
] | null | null | null | import os
import sys
import json
import numpy as np
from sys import platform
from rsyslog_cee import log
from bandolier import message_queue
from bandolier import data_tools
from bandolier.s3util import S3
import consul
import requests
log.set_service_name('concierge')
log.reset()
# ============================... | 35.668421 | 140 | 0.682013 | import os
import sys
import json
import numpy as np
from sys import platform
from rsyslog_cee import log
from bandolier import message_queue
from bandolier import data_tools
from bandolier.s3util import S3
import consul
import requests
log.set_service_name('concierge')
log.reset()
CF_EVENT = 'event'
CF_MEDIA =... | true | true |
1c11e7c771faeddb305daa25f4b6df9138af28bb | 19,684 | py | Python | attribution/integrated_gradients.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | attribution/integrated_gradients.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | attribution/integrated_gradients.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 50.342711 | 80 | 0.704125 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import six
import tensorflow.compat.v1 as tf
from tensorflow.contrib import graph_editor as contrib_graph_editor
def AddIntegratedGradientsOps(graph,
attribution_te... | true | true |
1c11e7e2ca72271b5e6bd2ba8ad23db3a59f082f | 3,791 | py | Python | test/test_decorator.py | usermicrodevices/pywingui | 97a5d3c54ff844da6e06b4ad886305e01574958b | [
"MIT"
] | null | null | null | test/test_decorator.py | usermicrodevices/pywingui | 97a5d3c54ff844da6e06b4ad886305e01574958b | [
"MIT"
] | null | null | null | test/test_decorator.py | usermicrodevices/pywingui | 97a5d3c54ff844da6e06b4ad886305e01574958b | [
"MIT"
] | null | null | null | ## Copyright (c) 2003 - 2004 Henk Punt
## 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, merge, pub... | 35.101852 | 91 | 0.683461 |
from pywingui.windows import *
from pywingui.wtl import *
from pywingui.lib import form
from pywingui import gdi
from pywingui import comctl
from pywingui.lib import splitter
from pywingui.lib import tree
comctl.InitCommonControls(comctl.ICC_LISTVIEW_CLASSES | comctl.ICC_COOL_CLASSES |\
... | false | true |
1c11e831b0ad31a3c450c70e7f7c258455409d05 | 9,126 | py | Python | python/paddle/fluid/tests/unittests/test_sync_batch_norm_op.py | jiansowa/Paddle | 488152a6d076eac91ef0921ff6e16c65777f814d | [
"Apache-2.0"
] | 8 | 2019-06-16T12:36:11.000Z | 2021-03-05T05:33:21.000Z | python/paddle/fluid/tests/unittests/test_sync_batch_norm_op.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | 1 | 2020-09-10T09:05:52.000Z | 2020-09-10T09:06:22.000Z | python/paddle/fluid/tests/unittests/test_sync_batch_norm_op.py | wozna/Paddle | 0ecf441af14d554c85f69a206e3e3a9bdd86fb13 | [
"Apache-2.0"
] | 25 | 2019-12-07T02:14:14.000Z | 2021-12-30T06:16:30.000Z | # Copyright (c) 2019 PaddlePaddle 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 app... | 37.555556 | 84 | 0.565746 |
from __future__ import print_function
import unittest
import numpy as np
import os
import six
import paddle
import paddle.fluid.core as core
import paddle.fluid as fluid
from paddle.fluid import compiler
from paddle.fluid import Program, program_guard
from op_test import OpTest, _set_use_system_allocator
_set_use_s... | true | true |
1c11e892e8aa029fc44de24437f8d557bd374c7b | 1,338 | py | Python | pyti/relative_strength_index.py | opz/pyti | 1ecc174195525bb3bdf401252244f80f02df04ef | [
"MIT"
] | 1 | 2020-09-28T16:52:41.000Z | 2020-09-28T16:52:41.000Z | pyti/relative_strength_index.py | opz/pyti | 1ecc174195525bb3bdf401252244f80f02df04ef | [
"MIT"
] | null | null | null | pyti/relative_strength_index.py | opz/pyti | 1ecc174195525bb3bdf401252244f80f02df04ef | [
"MIT"
] | 1 | 2020-03-10T19:34:11.000Z | 2020-03-10T19:34:11.000Z | from __future__ import absolute_import
import numpy as np
from pyti import catch_errors
from pyti.function_helper import fill_for_noncomputable_vals
from six.moves import range
from six.moves import zip
def relative_strength_index(data, period):
"""
Relative Strength Index.
Formula:
RSI = 100 - (100 ... | 26.76 | 84 | 0.591181 | from __future__ import absolute_import
import numpy as np
from pyti import catch_errors
from pyti.function_helper import fill_for_noncomputable_vals
from six.moves import range
from six.moves import zip
def relative_strength_index(data, period):
catch_errors.check_for_period_error(data, period)
period = int(... | true | true |
1c11e8c737ba89394813afe76d95550511a8d0dd | 2,370 | py | Python | docs/source/conf.py | SakuRautio/VersionManager | 28bd835934b2a94fcc1c5b11808267a1d4e394a9 | [
"MIT"
] | null | null | null | docs/source/conf.py | SakuRautio/VersionManager | 28bd835934b2a94fcc1c5b11808267a1d4e394a9 | [
"MIT"
] | null | null | null | docs/source/conf.py | SakuRautio/VersionManager | 28bd835934b2a94fcc1c5b11808267a1d4e394a9 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 37.619048 | 96 | 0.682278 |
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
sys.path.insert(0, os.path.abspath('../../VersionEmailer'))
sys.path.insert(0, os.path.abspath('../../VersionFileGenerator'))
project = 'Version Manager'
copyright = '2020, Saku Rautio'
author = 'Saku Rautio'
extensions = ['sphinx.ext.napoleon']
... | true | true |
1c11e941e2a68ce6829cf223ad3913a4e7d3dc95 | 2,686 | py | Python | tests/test_cli.py | TileDB-Inc/tilesegy | d7a7703eea62dd27bcc1444d932bd4efaa50293c | [
"MIT"
] | null | null | null | tests/test_cli.py | TileDB-Inc/tilesegy | d7a7703eea62dd27bcc1444d932bd4efaa50293c | [
"MIT"
] | 3 | 2020-12-21T15:52:03.000Z | 2021-01-15T11:48:21.000Z | tests/test_cli.py | TileDB-Inc/tilesegy | d7a7703eea62dd27bcc1444d932bd4efaa50293c | [
"MIT"
] | null | null | null | import pathlib
from unittest import mock
import pytest
from tiledb.segy import cli
@mock.patch("segyio.open")
@mock.patch("tiledb.segy.cli.SegyFileConverter")
def test_minimal(
SegyFileConverter: mock.Mock, segyio_open: mock.Mock, tmp_path: pathlib.Path
) -> None:
cli.main([str(tmp_path)])
assert segyi... | 32.361446 | 87 | 0.669397 | import pathlib
from unittest import mock
import pytest
from tiledb.segy import cli
@mock.patch("segyio.open")
@mock.patch("tiledb.segy.cli.SegyFileConverter")
def test_minimal(
SegyFileConverter: mock.Mock, segyio_open: mock.Mock, tmp_path: pathlib.Path
) -> None:
cli.main([str(tmp_path)])
assert segyi... | true | true |
1c11e9c6ecc90c8376913cf2dfb7710fe05c88f4 | 18,116 | py | Python | ansys/dpf/core/operators/result/joint_force_reaction.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 18 | 2021-10-16T10:38:29.000Z | 2022-03-29T11:26:42.000Z | ansys/dpf/core/operators/result/joint_force_reaction.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 79 | 2021-10-11T23:18:54.000Z | 2022-03-29T14:53:14.000Z | ansys/dpf/core/operators/result/joint_force_reaction.py | jfthuong/pydpf-core | bf2895ebc546e0004f759289bfc9a23196559ac3 | [
"MIT"
] | 5 | 2021-11-29T18:35:37.000Z | 2022-03-16T16:49:21.000Z | """
joint_force_reaction
===============
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecifica... | 34.506667 | 92 | 0.601402 | from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecification, Specification
class joint_force_reaction(Operator):
def __init__(
... | true | true |
1c11ea8a6ef29ae38dae1cfe62b28663162c1d9e | 585 | py | Python | python/util/flip_gradient.py | mega002/DANN-MNLI | bd27c5ec70d2b68453dd16f90a3b8d2f28f7a945 | [
"Apache-2.0"
] | 73 | 2019-08-14T09:25:02.000Z | 2022-03-25T07:19:45.000Z | python/util/flip_gradient.py | mega002/DANN-MNLI | bd27c5ec70d2b68453dd16f90a3b8d2f28f7a945 | [
"Apache-2.0"
] | 3 | 2020-02-25T06:39:52.000Z | 2020-12-26T12:40:23.000Z | python/util/flip_gradient.py | mega002/DANN-MNLI | bd27c5ec70d2b68453dd16f90a3b8d2f28f7a945 | [
"Apache-2.0"
] | 13 | 2019-09-22T03:45:21.000Z | 2021-11-22T06:52:28.000Z | import tensorflow as tf
from tensorflow.python.framework import ops
class FlipGradientBuilder(object):
def __init__(self):
self.num_calls = 0
def __call__(self, x, l=1.0):
grad_name = "FlipGradient%d" % self.num_calls
@ops.RegisterGradient(grad_name)
def _flip_gradients(op, g... | 23.4 | 62 | 0.635897 | import tensorflow as tf
from tensorflow.python.framework import ops
class FlipGradientBuilder(object):
def __init__(self):
self.num_calls = 0
def __call__(self, x, l=1.0):
grad_name = "FlipGradient%d" % self.num_calls
@ops.RegisterGradient(grad_name)
def _flip_gradients(op, g... | true | true |
1c11eade1fb894e24a627cc92fab6998d11884cb | 5,291 | py | Python | tensorflow_probability/python/experimental/nn/layers_test.py | mjul/tensorflow-probability | c733f06bccceb983f3e9db8e6e3c98b3bd4d23c9 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/nn/layers_test.py | mjul/tensorflow-probability | c733f06bccceb983f3e9db8e6e3c98b3bd4d23c9 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/experimental/nn/layers_test.py | mjul/tensorflow-probability | c733f06bccceb983f3e9db8e6e3c98b3bd4d23c9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.039735 | 81 | 0.688528 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.experimental import nn
from tensorflow_probability.python.internal import test_util
tfd = tfp.distri... | true | true |
1c11eb1b7817a69a30808dbc5a3d9874ad91c4cb | 1,098 | py | Python | web/tests/__init__.py | solidaritreebiz/Solidaritree | 15cc2e10e4cec56eb4fe218166d4157fcce9bf8d | [
"MIT"
] | null | null | null | web/tests/__init__.py | solidaritreebiz/Solidaritree | 15cc2e10e4cec56eb4fe218166d4157fcce9bf8d | [
"MIT"
] | null | null | null | web/tests/__init__.py | solidaritreebiz/Solidaritree | 15cc2e10e4cec56eb4fe218166d4157fcce9bf8d | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2014 Kord Campbell, StackGeek
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, mo... | 47.73913 | 77 | 0.798725 | true | true | |
1c11eb32c7ade7145aea48e7958bf743a46d293d | 1,624 | py | Python | pyjobs_web/pyjobsweb/tests/models/__init__.py | pyjobs/web | 183742ae571ee83d4fe4b34f1f0ce9f2204c449e | [
"MIT"
] | 8 | 2016-01-29T13:06:26.000Z | 2020-11-02T07:23:57.000Z | pyjobs_web/pyjobsweb/tests/models/__init__.py | pyjobs/web | 183742ae571ee83d4fe4b34f1f0ce9f2204c449e | [
"MIT"
] | 18 | 2016-02-11T08:17:13.000Z | 2022-03-02T14:53:38.000Z | pyjobs_web/pyjobsweb/tests/models/__init__.py | pyjobs/web | 183742ae571ee83d4fe4b34f1f0ce9f2204c449e | [
"MIT"
] | 5 | 2016-02-05T08:57:12.000Z | 2018-01-15T08:19:43.000Z | # -*- coding: utf-8 -*-
"""Unit test suite for the models of the application."""
from nose.tools import eq_
from pyjobsweb.model import DBSession
from pyjobsweb.tests import load_app
from pyjobsweb.tests import setup_db, teardown_db
__all__ = ['ModelTest']
def setup():
"""Setup test fixture for all model tests... | 24.606061 | 72 | 0.602217 |
from nose.tools import eq_
from pyjobsweb.model import DBSession
from pyjobsweb.tests import load_app
from pyjobsweb.tests import setup_db, teardown_db
__all__ = ['ModelTest']
def setup():
load_app()
setup_db()
def teardown():
teardown_db()
class ModelTest(object):
klass = None
attrs = {}
... | true | true |
1c11ec233a98dd87fbfa62ed6fe6571685a1c1bc | 30,343 | py | Python | evcouplings/compare/sifts.py | thomashopf/EVcouplings-1 | d3e4947d29b62537bd79215ce72b6eea18134850 | [
"MIT"
] | 1 | 2020-06-23T16:03:16.000Z | 2020-06-23T16:03:16.000Z | evcouplings/compare/sifts.py | aggreen/EVcouplings | a3780dec6570ebec4facd62e9f968423f68c971d | [
"MIT"
] | null | null | null | evcouplings/compare/sifts.py | aggreen/EVcouplings | a3780dec6570ebec4facd62e9f968423f68c971d | [
"MIT"
] | 2 | 2021-04-03T14:19:12.000Z | 2021-04-05T17:34:32.000Z | """
Uniprot to PDB structure identification and
index mapping using the SIFTS database
(https://www.ebi.ac.uk/pdbe/docs/sifts/)
This functionality is centered around the
pdb_chain_uniprot.csv table available from SIFTS.
(ftp://ftp.ebi.ac.uk/pub/databases/msd/sifts/flatfiles/csv/pdb_chain_uniprot.csv.gz)
Authors:
Th... | 34.324661 | 104 | 0.577431 |
from os import path
from collections import OrderedDict
from copy import deepcopy
import pandas as pd
import requests
from evcouplings.align.alignment import (
Alignment, read_fasta, parse_header
)
from evcouplings.align.protocol import (
jackhmmer_search, hmmbuild_and_search
)
from evcouplings.align.tools i... | true | true |
1c11ec40ac744d774f0fc3b855c14380acdc9f58 | 391 | py | Python | skactiveml/classifier/__init__.py | LukasLuehrs/scikit-activeml | 04d7107272ef0438070808475599131d8726f547 | [
"BSD-3-Clause"
] | null | null | null | skactiveml/classifier/__init__.py | LukasLuehrs/scikit-activeml | 04d7107272ef0438070808475599131d8726f547 | [
"BSD-3-Clause"
] | null | null | null | skactiveml/classifier/__init__.py | LukasLuehrs/scikit-activeml | 04d7107272ef0438070808475599131d8726f547 | [
"BSD-3-Clause"
] | null | null | null | """
The :mod:`skactiveml.classifier` module.
"""
from ._mixture_model_classifier import MixtureModelClassifier
from ._parzen_window_classifier import ParzenWindowClassifier
from ._wrapper import SklearnClassifier, SlidingWindowClassifier
__all__ = [
"multiannotator",
"ParzenWindowClassifier",
"MixtureModel... | 26.066667 | 64 | 0.790281 | from ._mixture_model_classifier import MixtureModelClassifier
from ._parzen_window_classifier import ParzenWindowClassifier
from ._wrapper import SklearnClassifier, SlidingWindowClassifier
__all__ = [
"multiannotator",
"ParzenWindowClassifier",
"MixtureModelClassifier",
"SklearnClassifier",
"Slidin... | true | true |
1c11ec96e976ef1eb6620afae608247a9ff00467 | 915 | py | Python | setup.py | ayharano/scrapy-proxies | d0b06dd8bdc7bd4cbdd79b2b05def0f534a07422 | [
"MIT"
] | null | null | null | setup.py | ayharano/scrapy-proxies | d0b06dd8bdc7bd4cbdd79b2b05def0f534a07422 | [
"MIT"
] | null | null | null | setup.py | ayharano/scrapy-proxies | d0b06dd8bdc7bd4cbdd79b2b05def0f534a07422 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
from distutils.core import setup
with open('README.md', 'r') as readme_file:
long_description = readme_file.read()
setup(name='scrapy-proxies',
version='0.4',
description='Scrapy Proxies: random proxy middleware for Scrapy',
author='Aivars Kalvans',
... | 31.551724 | 73 | 0.605464 | import sys
from distutils.core import setup
with open('README.md', 'r') as readme_file:
long_description = readme_file.read()
setup(name='scrapy-proxies',
version='0.4',
description='Scrapy Proxies: random proxy middleware for Scrapy',
author='Aivars Kalvans',
author_email='aivar... | true | true |
1c11ecb79735751fae53fde9a708ecace23336f2 | 404 | py | Python | djangorestapi/wsgi.py | markon/django-rest-quickstart | e94614f7672909009a0b9c3e2173e92e11f73bef | [
"Apache-2.0"
] | 10 | 2018-08-05T18:27:45.000Z | 2021-04-15T03:10:12.000Z | djangorestapi/wsgi.py | markon/django-rest-quickstart | e94614f7672909009a0b9c3e2173e92e11f73bef | [
"Apache-2.0"
] | 5 | 2020-02-11T21:49:40.000Z | 2021-06-10T17:33:34.000Z | djangorestapi/wsgi.py | markon/django-rest-quickstart | e94614f7672909009a0b9c3e2173e92e11f73bef | [
"Apache-2.0"
] | 1 | 2021-03-11T13:42:10.000Z | 2021-03-11T13:42:10.000Z | """
WSGI config for djangorestapi 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.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | 23.764706 | 78 | 0.792079 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangorestapi.settings")
application = get_wsgi_application()
| true | true |
1c11ecc79c0d2836be651f143358bbd17340548d | 216 | py | Python | month01/day03/demo06.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | 1 | 2021-02-02T02:17:37.000Z | 2021-02-02T02:17:37.000Z | month01/day03/demo06.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | month01/day03/demo06.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | """
选择语句:让代码有选择性的执行
if 条件:
满足条件执行的逻辑
else:
不满足条件执行的逻辑
"""
# 如果 有钱:
# 出售给你
# 否则
# 不卖
if int(input("请输入您的财产:")) > 100000000:
print("出售给你")
else: # 互斥
print("不卖") | 14.4 | 38 | 0.467593 | if int(input("请输入您的财产:")) > 100000000:
print("出售给你")
else: print("不卖") | true | true |
1c11ed5063dd292e1313ebed0c19656ca2dfaae2 | 248 | py | Python | manage.py | Musbell/iwbsrs | ea7343361027ca877f61903d553ce01504840e8c | [
"MIT"
] | null | null | null | manage.py | Musbell/iwbsrs | ea7343361027ca877f61903d553ce01504840e8c | [
"MIT"
] | 10 | 2020-03-24T15:36:11.000Z | 2022-01-13T00:41:38.000Z | manage.py | Musbell/iwbsrs | ea7343361027ca877f61903d553ce01504840e8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iwsrs.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 22.545455 | 69 | 0.770161 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "iwsrs.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c11ed53540466032ec4c3f22e044b899e1bdc54 | 4,750 | py | Python | club_crm/api/app/pg.py | VivekChamp/clubcrm | 82036360d867d3dc5406bc71445a98841b5bffbf | [
"MIT"
] | null | null | null | club_crm/api/app/pg.py | VivekChamp/clubcrm | 82036360d867d3dc5406bc71445a98841b5bffbf | [
"MIT"
] | null | null | null | club_crm/api/app/pg.py | VivekChamp/clubcrm | 82036360d867d3dc5406bc71445a98841b5bffbf | [
"MIT"
] | null | null | null | import frappe
import re
import uuid
from frappe.utils import now
import hashlib
import hmac
import hashlib
import base64
from datetime import datetime
import random
import string
@frappe.whitelist(allow_guest = True)
def create_log(**kwargs):
kwargs=frappe._dict(kwargs)
doc = frappe.new_doc("Payment Log")
... | 36.821705 | 312 | 0.717053 | import frappe
import re
import uuid
from frappe.utils import now
import hashlib
import hmac
import hashlib
import base64
from datetime import datetime
import random
import string
@frappe.whitelist(allow_guest = True)
def create_log(**kwargs):
kwargs=frappe._dict(kwargs)
doc = frappe.new_doc("Payment Log")
... | true | true |
1c11ed71f36a9cd652319a8fedc9cce3de393d7c | 9,408 | py | Python | tests/command_acceptor/CommandFactoryTests.py | andrii-z4i/xmind-telegram | 82e50ae0ada048b87a2c082bbdd4510e02cb3694 | [
"MIT"
] | null | null | null | tests/command_acceptor/CommandFactoryTests.py | andrii-z4i/xmind-telegram | 82e50ae0ada048b87a2c082bbdd4510e02cb3694 | [
"MIT"
] | 16 | 2018-05-07T09:42:56.000Z | 2018-11-19T06:05:51.000Z | tests/command_acceptor/CommandFactoryTests.py | andrii-z4i/xmind-telegram | 82e50ae0ada048b87a2c082bbdd4510e02cb3694 | [
"MIT"
] | null | null | null | from tests.command_acceptor.base import Base
from unittest import TestCase
from unittest.mock import patch, Mock
from shared.model.AcceptedMessage import AcceptedMessage
from shared.model.Command import Command
from cmp_command_acceptor.app.controllers.implementations.CommandFactory import CommandFactory
import json
... | 47.276382 | 339 | 0.549745 | from tests.command_acceptor.base import Base
from unittest import TestCase
from unittest.mock import patch, Mock
from shared.model.AcceptedMessage import AcceptedMessage
from shared.model.Command import Command
from cmp_command_acceptor.app.controllers.implementations.CommandFactory import CommandFactory
import json
... | true | true |
1c11ee614ec81f0a4ca83486fbcf49afbb51d747 | 5,829 | py | Python | python-sc2/sc2/expiring_dict.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 9 | 2020-04-28T12:12:23.000Z | 2022-03-14T03:45:45.000Z | python-sc2/sc2/expiring_dict.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 5 | 2021-03-30T05:10:49.000Z | 2022-01-13T04:32:05.000Z | python-sc2/sc2/expiring_dict.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 4 | 2020-04-28T12:14:58.000Z | 2022-02-22T07:15:28.000Z | from collections import OrderedDict
from threading import RLock
from typing import Dict, Iterable, List, Union, TYPE_CHECKING
if TYPE_CHECKING:
from sc2.bot_ai import BotAI
class ExpiringDict(OrderedDict):
"""
An expiring dict that uses the bot.state.game_loop to only return items that are valid for a sp... | 35.542683 | 121 | 0.524618 | from collections import OrderedDict
from threading import RLock
from typing import Dict, Iterable, List, Union, TYPE_CHECKING
if TYPE_CHECKING:
from sc2.bot_ai import BotAI
class ExpiringDict(OrderedDict):
def __init__(self, bot: "BotAI", max_age_frames: int = 1):
assert max_age_frames >= -1
... | true | true |
1c11eed4320a3de991254b3d3788644d52306706 | 1,005 | py | Python | tests/test_find_and_replace.py | ecatkins/datefinder | 8e880f20180e0105db8cefb324dcd38d3b890618 | [
"MIT"
] | 1 | 2020-09-19T13:32:35.000Z | 2020-09-19T13:32:35.000Z | tests/test_find_and_replace.py | ecatkins/datefinder | 8e880f20180e0105db8cefb324dcd38d3b890618 | [
"MIT"
] | null | null | null | tests/test_find_and_replace.py | ecatkins/datefinder | 8e880f20180e0105db8cefb324dcd38d3b890618 | [
"MIT"
] | null | null | null | import pytest
import datefinder
import copy
import sys, logging
from datefinder.constants import REPLACEMENTS
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
logger = logging.getLogger(__name__)
@pytest.mark.parametrize('date_string, expected_replaced_string, captures, expected_tz_string', [
('due on... | 34.655172 | 97 | 0.775124 | import pytest
import datefinder
import copy
import sys, logging
from datefinder.constants import REPLACEMENTS
logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
logger = logging.getLogger(__name__)
@pytest.mark.parametrize('date_string, expected_replaced_string, captures, expected_tz_string', [
('due on... | true | true |
1c11ef19a5d4a9d3c9e8d940047a54961c5ce632 | 784 | py | Python | packages/api-server/api_server/rmf_io/operators/heartbeat.py | baviera08/romi-dashboard | ac3a15014ad3c3bdac523a6550934a06653cfba1 | [
"Apache-2.0"
] | 2 | 2021-02-22T06:08:25.000Z | 2021-03-05T12:14:51.000Z | packages/api-server/api_server/rmf_io/operators/heartbeat.py | baviera08/romi-dashboard | ac3a15014ad3c3bdac523a6550934a06653cfba1 | [
"Apache-2.0"
] | 77 | 2020-12-08T22:10:22.000Z | 2021-03-09T00:44:47.000Z | packages/api-server/api_server/rmf_io/operators/heartbeat.py | baviera08/romi-dashboard | ac3a15014ad3c3bdac523a6550934a06653cfba1 | [
"Apache-2.0"
] | 1 | 2021-01-11T05:35:28.000Z | 2021-01-11T05:35:28.000Z | import rx
from rx.operators import buffer_with_time_or_count, distinct_until_changed
from rx.operators import map as rx_map
def heartbeat(liveliness):
"""
Projects a source observable sequence to a boolean. The resulting value is True when there
is an observable emitted within the liveliness factor and Fa... | 39.2 | 96 | 0.729592 | import rx
from rx.operators import buffer_with_time_or_count, distinct_until_changed
from rx.operators import map as rx_map
def heartbeat(liveliness):
return rx.pipe(
buffer_with_time_or_count(liveliness, 1),
rx_map(lambda items: len(items) > 0),
distinct_until_changed(),
)
| true | true |
1c11ef73d1955e037e8247f684eff52234753a41 | 1,075 | py | Python | Angle_model_file/detect_ANGLE.py | HAIbingshuai/chinese_ocr | 36c06226b3762b2e516427579f2c2614770e60ae | [
"MIT"
] | 21 | 2019-11-16T15:12:17.000Z | 2022-02-24T03:08:44.000Z | Angle_model_file/detect_ANGLE.py | HAIbingshuai/chinese_ocr | 36c06226b3762b2e516427579f2c2614770e60ae | [
"MIT"
] | 1 | 2019-12-03T00:41:09.000Z | 2020-10-16T13:46:11.000Z | Angle_model_file/detect_ANGLE.py | HAIbingshuai/chinese_ocr | 36c06226b3762b2e516427579f2c2614770e60ae | [
"MIT"
] | 3 | 2019-12-10T02:43:20.000Z | 2021-05-12T07:31:41.000Z | # coding=utf-8 python3.6
# ================================================================
# Copyright (C) 2019 * Ltd. All rights reserved.
# license='MIT License'
# Author : haibingshuai
# Created date: 2019/11/8 9:38
# Description :
# ================================================================
... | 29.861111 | 66 | 0.524651 |
from Angle_model_file.text.opencv_dnn_detect import angle_detect
from PIL import Image
import numpy as np
class text_ANGLE(object):
def __init__(self):
self.angleModel = angle_detect
def detect_angle(self, img):
angle = self.angleModel(img)
if angle == 90:
im = Image.from... | true | true |
1c11efa5b5c3d2bdd04ef7352f4a5056a9327269 | 6,493 | py | Python | tests/test_motm_algorithms.py | jutanke/pak | 6f3be954ef68804ebe622cafe46f033ccf6eb2e7 | [
"MIT"
] | 20 | 2018-09-19T06:52:01.000Z | 2020-10-02T11:18:00.000Z | tests/test_motm_algorithms.py | jutanke/pak | 6f3be954ef68804ebe622cafe46f033ccf6eb2e7 | [
"MIT"
] | 2 | 2018-06-22T08:22:39.000Z | 2020-07-20T06:50:59.000Z | tests/test_motm_algorithms.py | justayak/pak | 6f3be954ef68804ebe622cafe46f033ccf6eb2e7 | [
"MIT"
] | 3 | 2020-01-12T08:51:09.000Z | 2020-10-06T05:47:24.000Z | import unittest
import sys
sys.path.insert(0, '../')
import numpy as np
from math import sqrt
import numpy.linalg as la
from pak.evaluation import MOTP, MOTA
class TestMOTM_algorithms(unittest.TestCase):
def test_MOTA_aabb_idsw(self):
Gt = np.array([
[1, 1, 0, 0, 1, 1],
[1, 2, 1,... | 24.877395 | 82 | 0.38811 | import unittest
import sys
sys.path.insert(0, '../')
import numpy as np
from math import sqrt
import numpy.linalg as la
from pak.evaluation import MOTP, MOTA
class TestMOTM_algorithms(unittest.TestCase):
def test_MOTA_aabb_idsw(self):
Gt = np.array([
[1, 1, 0, 0, 1, 1],
[1, 2, 1,... | true | true |
1c11f0c82fc971489345980b8f9006aac368c375 | 46,700 | py | Python | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | 10088/neutron | 38cdfb88558887b830514b4ef390fd535c11942c | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | 10088/neutron | 38cdfb88558887b830514b4ef390fd535c11942c | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py | 10088/neutron | 38cdfb88558887b830514b4ef390fd535c11942c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2012 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... | 44.391635 | 79 | 0.592998 |
import sys
import netaddr
from neutron_lib.agent import topics
from neutron_lib import constants
from neutron_lib import exceptions
from neutron_lib.plugins import utils as plugin_utils
from neutron_lib.utils import helpers
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
from osl... | true | true |
1c11f15eadeb33e8886550e5cecd07786baec4a4 | 3,971 | py | Python | cogs/eval.py | shoddyDEV/isobot-discord-bot-python | c95dffa73ece8d38e17f3a962db8c0655f628e83 | [
"MIT"
] | null | null | null | cogs/eval.py | shoddyDEV/isobot-discord-bot-python | c95dffa73ece8d38e17f3a962db8c0655f628e83 | [
"MIT"
] | null | null | null | cogs/eval.py | shoddyDEV/isobot-discord-bot-python | c95dffa73ece8d38e17f3a962db8c0655f628e83 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.ext.commands import *
import io, textwrap, traceback, inspect, sys
from contextlib import redirect_stdout
class EvalCommand(commands.Cog):
def __init__(self, client:commands.Bot):
self.client = client
def cleanup_code(self, content):
... | 37.11215 | 153 | 0.488542 | import discord
from discord.ext import commands
from discord.ext.commands import *
import io, textwrap, traceback, inspect, sys
from contextlib import redirect_stdout
class EvalCommand(commands.Cog):
def __init__(self, client:commands.Bot):
self.client = client
def cleanup_code(self, content):
... | true | true |
1c11f26c5da105a579fcd070aab809a65a6af49a | 2,611 | py | Python | reagent/training/ranking/seq2slate_attn_trainer.py | wall-ed-coder/ReAgent | 14d9906d74f943e74c6a6f95d129e18741168f9c | [
"BSD-3-Clause"
] | 1 | 2021-05-03T15:18:58.000Z | 2021-05-03T15:18:58.000Z | reagent/training/ranking/seq2slate_attn_trainer.py | ananthsub/ReAgent | 92f223a135b8fbc0942a217acb117ad0935897a3 | [
"BSD-3-Clause"
] | null | null | null | reagent/training/ranking/seq2slate_attn_trainer.py | ananthsub/ReAgent | 92f223a135b8fbc0942a217acb117ad0935897a3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import reagent.types as rlt
import torch
import torch.nn as nn
from reagent.core.dataclasses import field
from reagent.core.tracker import observable
from reagent.model_utils.seq2slate_utils import Seq2SlateMo... | 33.050633 | 76 | 0.703179 | import logging
import reagent.types as rlt
import torch
import torch.nn as nn
from reagent.core.dataclasses import field
from reagent.core.tracker import observable
from reagent.model_utils.seq2slate_utils import Seq2SlateMode
from reagent.models.seq2slate import Seq2SlateTransformerNet
from reagent.optimizer.union im... | true | true |
1c11f2d5192e45cf01d918c6d74ac34887fbe83e | 2,847 | py | Python | frappe/printing/doctype/print_format/print_format.py | chentaoz/frappe | ee3c4943bf6177ad3b410cdb0d802af486751a65 | [
"MIT"
] | 5 | 2017-09-12T15:56:31.000Z | 2022-03-09T13:50:21.000Z | frappe/printing/doctype/print_format/print_format.py | chentaoz/frappe | ee3c4943bf6177ad3b410cdb0d802af486751a65 | [
"MIT"
] | 212 | 2017-08-16T13:03:18.000Z | 2020-10-06T12:26:21.000Z | frappe/printing/doctype/print_format/print_format.py | chentaoz/frappe | ee3c4943bf6177ad3b410cdb0d802af486751a65 | [
"MIT"
] | 14 | 2020-11-04T11:22:44.000Z | 2022-02-01T20:59:37.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import frappe.utils
import json
from frappe import _
from frappe.utils.jinja import validate_template
from frappe.model.document im... | 31.285714 | 100 | 0.73797 |
from __future__ import unicode_literals
import frappe
import frappe.utils
import json
from frappe import _
from frappe.utils.jinja import validate_template
from frappe.model.document import Document
class PrintFormat(Document):
def validate(self):
if (self.standard=="Yes"
and not frappe.local.conf.get("develop... | true | true |
1c11f315232cc67f43d3ed6c68a1afdb781d5660 | 2,742 | py | Python | pyvar/cm/utils/helper.py | dorta/pyvar | c23e8e5a4b4d83e28e1bf1849ee736f2187dd4bc | [
"BSD-3-Clause"
] | 4 | 2021-12-11T15:31:54.000Z | 2022-02-03T22:18:04.000Z | pyvar/cm/utils/helper.py | varigit/pyvar | c23e8e5a4b4d83e28e1bf1849ee736f2187dd4bc | [
"BSD-3-Clause"
] | 1 | 2021-11-30T10:33:06.000Z | 2021-11-30T10:33:06.000Z | pyvar/cm/utils/helper.py | dorta/pyvar | c23e8e5a4b4d83e28e1bf1849ee736f2187dd4bc | [
"BSD-3-Clause"
] | 1 | 2022-02-06T18:39:17.000Z | 2022-02-06T18:39:17.000Z | # Copyright 2022 Variscite LTD
# SPDX-License-Identifier: BSD-3-Clause
"""
:platform: Unix/Yocto
:synopsis: Module with miscellaneous functions for Cortex-M.
.. moduleauthor:: Alifer Moraes <alifer.m@variscite.com>
"""
import os
import subprocess
from .config import *
def is_cm_enabled():
"""
Check if the... | 21.936 | 74 | 0.605033 |
import os
import subprocess
from .config import *
def is_cm_enabled():
return True if os.listdir(CM_REMOTEPROC_DIR) else False
def get_module():
if not os.path.exists(MACHINE):
return None
with open(MACHINE, 'r') as machine:
module = machine.read().lower()
if "var-som" in module... | true | true |
1c11f34356c99247e51e6a1a8d2da7d2ed9ee782 | 4,611 | py | Python | sdk/python/pulumi_azure_nextgen/resources/v20151101/get_resource.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/resources/v20151101/get_resource.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/resources/v20151101/get_resource.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 32.935714 | 134 | 0.636088 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetResourceResult',
'AwaitableGetResourceResult',
'get_resource',
]
@pulumi.output_type
class GetResourceResult:
def __... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.