hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4881f767953993d7e59e17538dbfd7fda1e5c264 | 983 | py | Python | cavirtex/__init__.py | kyonetca/cavirtex-sdk-python | 93f822474df7ddfebe18190f4cdd13faf9a37d84 | [
"MIT"
] | null | null | null | cavirtex/__init__.py | kyonetca/cavirtex-sdk-python | 93f822474df7ddfebe18190f4cdd13faf9a37d84 | [
"MIT"
] | null | null | null | cavirtex/__init__.py | kyonetca/cavirtex-sdk-python | 93f822474df7ddfebe18190f4cdd13faf9a37d84 | [
"MIT"
] | 1 | 2021-01-18T21:01:56.000Z | 2021-01-18T21:01:56.000Z | __author__ = '''
Dawson Reid (dreid93@gmail.com)
'''
# configure logging
import logging.config
logging.config.dictConfig({
'version': 1,
'disable_exsisting_loggers': False,
'formatters': {
'simple': {
'format': '[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s'
},
'coloured':... | 23.404762 | 138 | 0.547304 |
7d4dc70410ab4d733745d6ee1f430869e2d31708 | 2,222 | py | Python | athene/api/actions.py | alkurbatov/athene | 867797f7f7888ffab73a041eb17ec1b3753199bc | [
"MIT"
] | 3 | 2018-08-27T10:49:41.000Z | 2019-01-29T14:55:45.000Z | athene/api/actions.py | alkurbatov/athene | 867797f7f7888ffab73a041eb17ec1b3753199bc | [
"MIT"
] | null | null | null | athene/api/actions.py | alkurbatov/athene | 867797f7f7888ffab73a041eb17ec1b3753199bc | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2017-2018 Alexander Kurbatov
"""A set of actions definitions."""
import enum
from collections import namedtuple
# General
ACTION_ATTACK = 'attack'
ACTION_DO_NOTHING = 'donothing'
ACTION_HARVEST_MINERALS = 'harvestminerals'
ACTION_MOVE_TO_BEACON = 'movetobeacon'
ACTION_SELEC... | 26.771084 | 89 | 0.729073 |
b3f7c13a3cdfd887bf058e86836d3c0f3596085e | 11,678 | py | Python | demo/demo_dag.py | plynx-team/demo-nlp | 51d1b3272b92d342035db1dfd26294b368827ce3 | [
"Apache-2.0"
] | null | null | null | demo/demo_dag.py | plynx-team/demo-nlp | 51d1b3272b92d342035db1dfd26294b368827ce3 | [
"Apache-2.0"
] | 1 | 2022-03-08T01:08:51.000Z | 2022-03-08T01:08:51.000Z | demo/demo_dag.py | plynx-team/demo-nlp | 51d1b3272b92d342035db1dfd26294b368827ce3 | [
"Apache-2.0"
] | null | null | null | from plynx.plugins.executors import dag
import plynx.db.node
class DemoDAG(dag.DAG):
def __init__(self, *args, **argv):
super(DemoDAG, self).__init__(*args, **argv)
@classmethod
def get_default_node(cls, is_workflow):
node = super().get_default_node(is_workflow)
nodes_parameter = ... | 33.947674 | 550 | 0.340041 |
2d22422f51418a20ef6074f08641e0873e3e01a5 | 135,711 | py | Python | old_projects/waves.py | ishandutta2007/manim | 55674f64a5b4b3bf1ab05243410e81a94eca1e26 | [
"MIT"
] | null | null | null | old_projects/waves.py | ishandutta2007/manim | 55674f64a5b4b3bf1ab05243410e81a94eca1e26 | [
"MIT"
] | null | null | null | old_projects/waves.py | ishandutta2007/manim | 55674f64a5b4b3bf1ab05243410e81a94eca1e26 | [
"MIT"
] | null | null | null | from big_ol_pile_of_manim_imports import *
E_COLOR = BLUE
M_COLOR = YELLOW
class OscillatingVector(ContinualAnimation):
CONFIG = {
"tail" : ORIGIN,
"frequency" : 1,
"A_vect" : [1, 0, 0],
"phi_vect" : [0, 0, 0],
"vector_to_be_added_to" : None,
}
def setup(self):
... | 31.626893 | 91 | 0.539138 |
aaad45954c54ff6a1121a896735e34696329f3f2 | 7,631 | py | Python | config/settings/production.py | taumaa/django-blog-back | c4de2d44863d0feaf06d4b1fd0f7d4edc3ce667d | [
"MIT"
] | null | null | null | config/settings/production.py | taumaa/django-blog-back | c4de2d44863d0feaf06d4b1fd0f7d4edc3ce667d | [
"MIT"
] | null | null | null | config/settings/production.py | taumaa/django-blog-back | c4de2d44863d0feaf06d4b1fd0f7d4edc3ce667d | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env("DJANGO_SECRET_KEY")
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 43.357955 | 87 | 0.625737 |
cd41ceeac7a7f041d36edb030db3361f4f775ba0 | 272 | py | Python | torchvision/prototype/datasets/decoder.py | shuokay/vision | 136a16eaa604044d91485a91e47d9dc1e6a8d2d8 | [
"BSD-3-Clause"
] | null | null | null | torchvision/prototype/datasets/decoder.py | shuokay/vision | 136a16eaa604044d91485a91e47d9dc1e6a8d2d8 | [
"BSD-3-Clause"
] | null | null | null | torchvision/prototype/datasets/decoder.py | shuokay/vision | 136a16eaa604044d91485a91e47d9dc1e6a8d2d8 | [
"BSD-3-Clause"
] | null | null | null | import io
import numpy as np
import PIL.Image
import torch
__all__ = ["pil"]
def pil(file: io.IOBase, mode: str = "RGB") -> torch.Tensor:
image = PIL.Image.open(file).convert(mode.upper())
return torch.from_numpy(np.array(image, copy=True)).permute((2, 0, 1))
| 20.923077 | 74 | 0.680147 |
61e7c9df8f430ed0d576bc0ce7d6b2318d241832 | 344 | py | Python | backend/notification/routing.py | RyanSiu1995/Course_PWA_Client | bce0ea9406ceeef1def3f72bc48672b89dfcf13f | [
"MIT"
] | null | null | null | backend/notification/routing.py | RyanSiu1995/Course_PWA_Client | bce0ea9406ceeef1def3f72bc48672b89dfcf13f | [
"MIT"
] | 1 | 2018-05-12T16:37:34.000Z | 2018-05-13T14:43:55.000Z | backend/notification/routing.py | RyanSiu1995/Course_PWA_Client | bce0ea9406ceeef1def3f72bc48672b89dfcf13f | [
"MIT"
] | null | null | null | # mysite/routing.py
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from . import route
application = ProtocolTypeRouter({
# (http->django views is added by default)
'websocket': AuthMiddlewareStack(
URLRouter(
route.websocket_urlpatt... | 26.461538 | 58 | 0.715116 |
0e42b1bc04335fc864a08597463f800ec956a9dd | 32,006 | py | Python | sdk/python/pulumi_azure_native/network/v20190201/network_interface.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190201/network_interface.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190201/network_interface.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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, overload
from ... import _utilities
fro... | 54.617747 | 5,267 | 0.692714 |
498a202a25f48e5fedb03ad6701be24c3b062e2c | 17,655 | py | Python | test/webdnn_test/graph_test/variable_test.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | 1 | 2021-04-09T15:55:35.000Z | 2021-04-09T15:55:35.000Z | test/webdnn_test/graph_test/variable_test.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | test/webdnn_test/graph_test/variable_test.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | import numpy as np
from nose.tools import raises
from webdnn.graph.axis import Axis
from webdnn.graph.operators.abs import Abs
from webdnn.graph.operators.elementwise_add import ElementwiseAdd
from webdnn.graph.operators.elementwise_div import ElementwiseDiv
from webdnn.graph.operators.elementwise_mul import Elementwi... | 29.230132 | 98 | 0.661739 |
82d6bbb305e43ec4b2ab7ad969458735ccbd26c1 | 7,823 | py | Python | tests/http/test_stream.py | Daanvdk/jackie | c8529ea7a585e1c53288a154e147a55f4c790531 | [
"MIT"
] | null | null | null | tests/http/test_stream.py | Daanvdk/jackie | c8529ea7a585e1c53288a154e147a55f4c790531 | [
"MIT"
] | 2 | 2021-02-22T01:56:44.000Z | 2021-02-22T02:15:22.000Z | tests/http/test_stream.py | daanvdk/jackie | c8529ea7a585e1c53288a154e147a55f4c790531 | [
"MIT"
] | null | null | null | import asyncio
import tempfile
import pytest
from jackie.http.stream import Stream, SendFile
# Very simple stream implementation that allows us to specify the content type
class ContentTypeStream(Stream):
def __init__(self, body=b'', content_type='text/plain; charset=UTF-8'):
super().__init__(body)
... | 25.235484 | 78 | 0.6339 |
0141d133513ddbd544dbb239ad851d1501cf8e08 | 3,697 | py | Python | mmdet3d/models/middle_encoders/pillar_scatter.py | BB88Lee/mmdetection3d | 62aeeadf70ac1229c595e3a4fe09d8a49df808f1 | [
"Apache-2.0"
] | 136 | 2021-06-03T06:37:56.000Z | 2022-03-29T13:29:03.000Z | mmdet3d/models/middle_encoders/pillar_scatter.py | BB88Lee/mmdetection3d | 62aeeadf70ac1229c595e3a4fe09d8a49df808f1 | [
"Apache-2.0"
] | 38 | 2021-06-05T12:41:30.000Z | 2022-03-23T07:31:28.000Z | mmdet3d/models/middle_encoders/pillar_scatter.py | BB88Lee/mmdetection3d | 62aeeadf70ac1229c595e3a4fe09d8a49df808f1 | [
"Apache-2.0"
] | 15 | 2021-04-23T01:13:28.000Z | 2022-03-27T11:15:25.000Z | import torch
from mmcv.runner import auto_fp16
from torch import nn
from ..registry import MIDDLE_ENCODERS
@MIDDLE_ENCODERS.register_module()
class PointPillarsScatter(nn.Module):
"""Point Pillar's Scatter.
Converts learned features from dense tensor to sparse pseudo image.
Args:
in_channels (i... | 36.245098 | 79 | 0.606979 |
90b4393ffec358637b87f9b912edd1552c6910de | 724 | py | Python | client/merc/modules/setup/sucheck.py | jduck/drozer | 171b0346405c00808a53e94d25582adcba098cf1 | [
"BSD-Source-Code"
] | 3 | 2015-10-04T01:21:10.000Z | 2019-08-03T19:08:10.000Z | client/merc/modules/setup/sucheck.py | jduck/drozer | 171b0346405c00808a53e94d25582adcba098cf1 | [
"BSD-Source-Code"
] | null | null | null | client/merc/modules/setup/sucheck.py | jduck/drozer | 171b0346405c00808a53e94d25582adcba098cf1 | [
"BSD-Source-Code"
] | null | null | null | import os
from merc.lib.modules import Module
class sucheck(Module):
"""Description: Test if SU binary works on device
Credit: Tyrone Erasmus - MWR Labs"""
def __init__(self, *args, **kwargs):
Module.__init__(self, *args, **kwargs)
self.path = ["setup"]
def execute(self, session, _arg):
... | 36.2 | 104 | 0.617403 |
834c60327c97a511205d23326f6a03f55fd710e9 | 6,526 | py | Python | src/test/python/apache/aurora/client/cli/test_restart.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/test/python/apache/aurora/client/cli/test_restart.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/test/python/apache/aurora/client/cli/test_restart.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2014 Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 46.614286 | 99 | 0.740116 |
ba8294d80b9085f10a29890d8a0028900821dc72 | 6,324 | py | Python | tests/OpenMaya/test_MFnDependencyNode.py | christophercrouzet/bana | 8087df05ba9844b4d78d3c4699948ca61cf7621d | [
"MIT"
] | 24 | 2017-01-11T15:57:46.000Z | 2020-09-23T06:18:30.000Z | tests/OpenMaya/test_MFnDependencyNode.py | christophercrouzet/bana | 8087df05ba9844b4d78d3c4699948ca61cf7621d | [
"MIT"
] | null | null | null | tests/OpenMaya/test_MFnDependencyNode.py | christophercrouzet/bana | 8087df05ba9844b4d78d3c4699948ca61cf7621d | [
"MIT"
] | 2 | 2017-03-06T23:52:08.000Z | 2020-09-23T06:19:03.000Z | #!/usr/bin/env mayapy
import os
import sys
import unittest
import maya.standalone
from maya import OpenMaya, cmds
_HERE = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.abspath(os.path.join(_HERE, *((os.pardir,) * 2))))
import bana
import tests._util
bana.initialize()
maya.standalone.initia... | 44.223776 | 105 | 0.699873 |
3bf34cd136dc6acade0caf3e5dc2f8eb0381ef06 | 6,635 | py | Python | native_client_sdk/src/build_tools/build_app.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | native_client_sdk/src/build_tools/build_app.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | native_client_sdk/src/build_tools/build_app.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import json
import os
import re
import sys
if sys.version_info < (2, 7, 0):
sys.stderr.write("python 2.7 or late... | 34.921053 | 79 | 0.674755 |
5f9d1b037a1a3e14fa08e5fbc1e58e076d02efe8 | 1,246 | py | Python | ngallery/urls.py | manti-by/ngallery | e87340707d15f3f35ecf7cf761232dd5f40e1389 | [
"BSD-3-Clause"
] | null | null | null | ngallery/urls.py | manti-by/ngallery | e87340707d15f3f35ecf7cf761232dd5f40e1389 | [
"BSD-3-Clause"
] | null | null | null | ngallery/urls.py | manti-by/ngallery | e87340707d15f3f35ecf7cf761232dd5f40e1389 | [
"BSD-3-Clause"
] | null | null | null | """core URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | 34.611111 | 80 | 0.728732 |
40dfbc651da1f1b6d6fb554498701691ec786031 | 918 | py | Python | src/adafruit-circuitpython-bundle-4.x-mpy-20190713/examples/matrixkeypad_simpletest.py | mbaaba/solar_panel | 42059d8c61320494ad1298065dbc50cd9b3bd51e | [
"MIT"
] | 1 | 2020-04-13T16:10:53.000Z | 2020-04-13T16:10:53.000Z | infra/libs-400rc2-20190512/examples/matrixkeypad_simpletest.py | jadudm/feather-isa | b7419e6698c3f64be4d8122656eb8124631ca859 | [
"MIT"
] | null | null | null | infra/libs-400rc2-20190512/examples/matrixkeypad_simpletest.py | jadudm/feather-isa | b7419e6698c3f64be4d8122656eb8124631ca859 | [
"MIT"
] | null | null | null | import time
import digitalio
import board
import adafruit_matrixkeypad
# Membrane 3x4 matrix keypad - https://www.adafruit.com/product/419
cols = [digitalio.DigitalInOut(x) for x in (board.D9, board.D6, board.D5)]
rows = [digitalio.DigitalInOut(x) for x in (board.D13, board.D12, board.D11, board.D10)]
# 3x4 ... | 34 | 94 | 0.659041 |
cb5c07a42b70347d581414e2b3223efc7c51b8ac | 4,755 | py | Python | visualizations/network_communities/community_detection.py | junhaodong/misc | de367573ebaae2d75cf319b62ed1d41d99508bf8 | [
"MIT"
] | 2 | 2016-03-21T20:28:07.000Z | 2017-09-24T13:53:23.000Z | visualizations/network_communities/community_detection.py | junhaodong/misc | de367573ebaae2d75cf319b62ed1d41d99508bf8 | [
"MIT"
] | null | null | null | visualizations/network_communities/community_detection.py | junhaodong/misc | de367573ebaae2d75cf319b62ed1d41d99508bf8 | [
"MIT"
] | null | null | null | import networkx as nx
from networkx.algorithms import community
import matplotlib.pyplot as plt
import random
import itertools
def girvan_newman(G):
"""Returns an iterator over tuples of sets of nodes, and the edges that have been removed
Each set is a community; each tuple is all the communities at one step i... | 34.963235 | 102 | 0.671083 |
6b8925da169bd3fa8927e05369633f9ec7098e6d | 16,483 | py | Python | deepmusic/musicdata.py | RichardMcSorley/tensorflow-music | f6d80554c3fd8b1c54d8051aba3776e271886c1b | [
"Apache-2.0"
] | null | null | null | deepmusic/musicdata.py | RichardMcSorley/tensorflow-music | f6d80554c3fd8b1c54d8051aba3776e271886c1b | [
"Apache-2.0"
] | null | null | null | deepmusic/musicdata.py | RichardMcSorley/tensorflow-music | f6d80554c3fd8b1c54d8051aba3776e271886c1b | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Conchylicultor. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 42.481959 | 147 | 0.612146 |
3c1954ce6b9b5604a0ea353118851798eec94df2 | 2,906 | py | Python | scripts/strava_auth_handler.py | pnposch/runpandas | 25388c18b52dfcc168e81922b8ba20ca93adad20 | [
"MIT"
] | 11 | 2020-12-04T20:43:23.000Z | 2022-03-16T19:19:12.000Z | scripts/strava_auth_handler.py | pnposch/runpandas | 25388c18b52dfcc168e81922b8ba20ca93adad20 | [
"MIT"
] | 45 | 2020-06-23T02:50:31.000Z | 2022-02-15T16:56:00.000Z | scripts/strava_auth_handler.py | pnposch/runpandas | 25388c18b52dfcc168e81922b8ba20ca93adad20 | [
"MIT"
] | 4 | 2021-11-11T15:23:04.000Z | 2022-02-02T13:02:12.000Z | """
Simple Script for getting the Access token
Set up a client using stravalib
If prompted enter client ID and client secret from https://www.strava.com/settings/api
Upon authorisation, retrieve the 'code=' section of the url and input when prompted
"""
import json
import os
import webbrowser
import argparse
import ti... | 33.022727 | 87 | 0.668961 |
4e92fd9fecbfa8cb0fb4475087c970f982ba00dd | 1,331 | py | Python | Unet_Mobile/predict.py | Ice833/Semantic-Segmentation | 23d23f6da3b34884c044a2253d65a1e4097adb2d | [
"MIT"
] | 1 | 2020-12-16T08:29:13.000Z | 2020-12-16T08:29:13.000Z | Unet_Mobile/predict.py | Ice833/Semantic-Segmentation | 23d23f6da3b34884c044a2253d65a1e4097adb2d | [
"MIT"
] | null | null | null | Unet_Mobile/predict.py | Ice833/Semantic-Segmentation | 23d23f6da3b34884c044a2253d65a1e4097adb2d | [
"MIT"
] | null | null | null | from nets.unet import mobilenet_unet
from PIL import Image
import numpy as np
import random
import copy
import os
random.seed(0)
class_colors = [[0,0,0],[0,255,0]]
NCLASSES = 2
HEIGHT = 416
WIDTH = 416
model = mobilenet_unet(n_classes=NCLASSES,input_height=HEIGHT, input_width=WIDTH)
model.load_weights... | 27.163265 | 82 | 0.601052 |
633bf85cde584060fc4136c95bc20bb01efc0e11 | 169,888 | py | Python | dask/array/core.py | gmiretti/dask | a8bcd75f165196ba7058b52ac69138aa10042234 | [
"BSD-3-Clause"
] | null | null | null | dask/array/core.py | gmiretti/dask | a8bcd75f165196ba7058b52ac69138aa10042234 | [
"BSD-3-Clause"
] | null | null | null | dask/array/core.py | gmiretti/dask | a8bcd75f165196ba7058b52ac69138aa10042234 | [
"BSD-3-Clause"
] | null | null | null | import math
import operator
import os
import pickle
import re
import sys
import traceback
import uuid
import warnings
from bisect import bisect
from collections.abc import Iterable, Iterator, Mapping
from functools import partial, reduce, wraps
from itertools import product, zip_longest
from numbers import Integral, Nu... | 32.45854 | 112 | 0.585021 |
82b41f0d0aec99e3285e4c680406a60350bde755 | 610 | py | Python | old/wolframaplah_query_simple.py | gray123/google_echo | 3d6a94a6e5d04b92296b0ad05972cfd06f266574 | [
"Apache-2.0"
] | null | null | null | old/wolframaplah_query_simple.py | gray123/google_echo | 3d6a94a6e5d04b92296b0ad05972cfd06f266574 | [
"Apache-2.0"
] | null | null | null | old/wolframaplah_query_simple.py | gray123/google_echo | 3d6a94a6e5d04b92296b0ad05972cfd06f266574 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import sys, urllib, urllib2, json
if len(sys.argv) != 2:
usage='Usage: '+sys.argv[0]+' question_within_double_quotation_mark'
print usage
else:
querystr=urllib.quote_plus(sys.argv[1]);
API_URL='http://api.wolframalpha.com/v2/query?input='+querystr+'&appid=YV4XG4-KYWKHRV526&podindex=1&output=j... | 33.888889 | 114 | 0.701639 |
49f30d4dd1c9fe3e8906c6ef32676890adc329fe | 20,157 | py | Python | tests/test_string.py | amitwer/assertpy | d8f222ed8ccbf2c64475111134db555245831e48 | [
"BSD-3-Clause"
] | null | null | null | tests/test_string.py | amitwer/assertpy | d8f222ed8ccbf2c64475111134db555245831e48 | [
"BSD-3-Clause"
] | null | null | null | tests/test_string.py | amitwer/assertpy | d8f222ed8ccbf2c64475111134db555245831e48 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015-2018, Activision Publishing, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of ... | 37.053309 | 154 | 0.68661 |
8c04d70689518e38a9ae46beccd2410e8c026db0 | 6,507 | bzl | Python | setup.bzl | clintharrison/kythe | 9d690f19054e4627705da0f7c361174cbc39cb93 | [
"Apache-2.0"
] | null | null | null | setup.bzl | clintharrison/kythe | 9d690f19054e4627705da0f7c361174cbc39cb93 | [
"Apache-2.0"
] | null | null | null | setup.bzl | clintharrison/kythe | 9d690f19054e4627705da0f7c361174cbc39cb93 | [
"Apache-2.0"
] | null | null | null | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def github_archive(name, repo_name, commit, kind = "zip", strip_prefix = "", **kwargs):
"""Defines a GitHub commit-based repository rule."""
project = repo_name[repo_name.index("/... | 39.198795 | 132 | 0.663132 |
dda2f2486451f01a09c8d44b2c01bda9c6d4176d | 391 | py | Python | PyLudus/wsgi.py | AAADevs/PyLudus | c74defec007d5699eba74b8c2c60bfebd1d41383 | [
"MIT"
] | 5 | 2021-02-17T10:47:26.000Z | 2021-03-04T12:31:08.000Z | PyLudus/wsgi.py | ccall48/PyLudus | 69f0770113b1df67e731897877aedbda1e663590 | [
"MIT"
] | 2 | 2021-02-24T22:39:07.000Z | 2021-03-14T13:21:36.000Z | PyLudus/wsgi.py | AAADevs/PyLudus | c74defec007d5699eba74b8c2c60bfebd1d41383 | [
"MIT"
] | 2 | 2021-02-16T01:06:50.000Z | 2021-05-26T11:12:47.000Z | """
WSGI config for PyLudus 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/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 23 | 78 | 0.785166 |
ebb345d1f366cac4e0e95b49afe041067a84d482 | 3,845 | py | Python | qa/rpc-tests/maxblocksinflight.py | CHN-portal/CHN-Portal | 74c2a20f99add8fb45ce0722d1674496a3d28e7e | [
"MIT"
] | 1 | 2020-04-09T09:24:56.000Z | 2020-04-09T09:24:56.000Z | qa/rpc-tests/maxblocksinflight.py | CHN-portal/CHN-Portal | 74c2a20f99add8fb45ce0722d1674496a3d28e7e | [
"MIT"
] | 1 | 2019-12-14T01:05:46.000Z | 2019-12-14T18:24:42.000Z | qa/rpc-tests/maxblocksinflight.py | CHN-portal/CHN-Portal | 74c2a20f99add8fb45ce0722d1674496a3d28e7e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test nodes responses to having many blocks in flight.
In this test we connect to one node over p2p, se... | 39.234694 | 110 | 0.63225 |
373a41af18e7f8c7a6deb0d85d416b5db0504556 | 3,094 | py | Python | examples/IFP.py | erow/disentanglement_lib | c875207fdeadc44880277542447544941bc0bd0a | [
"Apache-2.0"
] | null | null | null | examples/IFP.py | erow/disentanglement_lib | c875207fdeadc44880277542447544941bc0bd0a | [
"Apache-2.0"
] | null | null | null | examples/IFP.py | erow/disentanglement_lib | c875207fdeadc44880277542447544941bc0bd0a | [
"Apache-2.0"
] | null | null | null | from argparse import ArgumentParser
import gin
from pytorch_lightning.loggers.wandb import WandbLogger
import wandb
from disentanglement_lib.data.ground_truth.ground_truth_data import RandomAction
from disentanglement_lib.data.ground_truth.named_data import get_named_ground_truth_data
from disentanglement_lib.methods.s... | 35.976744 | 96 | 0.676794 |
73b65d8e86234f10cea1d1d60ffaab805ff4f41f | 2,526 | py | Python | rconweb/api/auto_settings.py | FlorianSW/hll_rcon_tool | 26a37b07eaab34dfb5a6d10c0f02e0fcae51dd88 | [
"MIT"
] | 49 | 2020-03-07T13:09:21.000Z | 2022-03-19T14:24:13.000Z | rconweb/api/auto_settings.py | FlorianSW/hll_rcon_tool | 26a37b07eaab34dfb5a6d10c0f02e0fcae51dd88 | [
"MIT"
] | 48 | 2020-03-26T22:19:40.000Z | 2021-12-12T17:31:06.000Z | rconweb/api/auto_settings.py | FlorianSW/hll_rcon_tool | 26a37b07eaab34dfb5a6d10c0f02e0fcae51dd88 | [
"MIT"
] | 48 | 2020-03-03T09:44:36.000Z | 2022-03-18T07:33:39.000Z | import os, json
from django.views.decorators.csrf import csrf_exempt
from rcon.user_config import AutoSettingsConfig
from .auth import login_required, api_response
from .utils import _get_data
from .multi_servers import forward_request
from .services import get_supervisor_client
AUTO_SETTINGS_KEY_ORDER = ["always_ap... | 34.60274 | 120 | 0.719319 |
fe96039e1d54481f22bd231dcf303a02979b4f8f | 3,144 | py | Python | sct_custom/spinalcordtoolbox/scripts/sct_compute_mscc.py | nidebroux/lumbosacral_segmentation | 3217960c6f0f5c3886dfdf46e1286ad2f737f4aa | [
"Unlicense",
"MIT"
] | 1 | 2021-09-07T08:52:21.000Z | 2021-09-07T08:52:21.000Z | sct_custom/spinalcordtoolbox/scripts/sct_compute_mscc.py | nidebroux/lumbosacral_segmentation | 3217960c6f0f5c3886dfdf46e1286ad2f737f4aa | [
"Unlicense",
"MIT"
] | null | null | null | sct_custom/spinalcordtoolbox/scripts/sct_compute_mscc.py | nidebroux/lumbosacral_segmentation | 3217960c6f0f5c3886dfdf46e1286ad2f737f4aa | [
"Unlicense",
"MIT"
] | null | null | null | #!/usr/bin/env python
#########################################################################################
#
# Compute maximum spinal cord compression.
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2015 Polytechnique Montreal <www.neuro.polymtl.ca>
# Au... | 32.081633 | 119 | 0.543575 |
57cdb5bbbc157eadb44484187405e3df64e290f9 | 417 | py | Python | Doxygen/index.py | tomkys144/WatchyBell | 75b57c961427d77ddfe4877bdb4919644bd44878 | [
"MIT"
] | null | null | null | Doxygen/index.py | tomkys144/WatchyBell | 75b57c961427d77ddfe4877bdb4919644bd44878 | [
"MIT"
] | null | null | null | Doxygen/index.py | tomkys144/WatchyBell | 75b57c961427d77ddfe4877bdb4919644bd44878 | [
"MIT"
] | null | null | null | import os
dirname = os.path.dirname(__file__)
with open(os.path.join(dirname, '../README.md'), 'r') as f:
readme = f.read()
f.close()
readme = readme.replace("WatchyBell", "%WatchyBell", 1)
readme = readme.replace("https://tomkys144.github.io/WatchyBell", "https://github.com/tomkys144/WatchyBell")
with ... | 27.8 | 108 | 0.671463 |
1f746a95a4b15979bba4829997de8333653a5189 | 3,135 | py | Python | pyjsonnlp/annotation/relations.py | SemiringInc/Py-JSON-NLP | 7db98f5180f328dfa26418cb00a0a5c4ce8095a5 | [
"Apache-2.0"
] | null | null | null | pyjsonnlp/annotation/relations.py | SemiringInc/Py-JSON-NLP | 7db98f5180f328dfa26418cb00a0a5c4ce8095a5 | [
"Apache-2.0"
] | null | null | null | pyjsonnlp/annotation/relations.py | SemiringInc/Py-JSON-NLP | 7db98f5180f328dfa26418cb00a0a5c4ce8095a5 | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from pyjsonnlp.annotation import Annotator
from pyjsonnlp.dependencies import UniversalDependencyParse
class RelationAnnotator(Annotator):
def annotate(self, nlp_json: OrderedDict) -> None:
for doc in nlp_json['documents'].values():
if 'relations' not in do... | 46.791045 | 104 | 0.484211 |
d4b17bf799478b77f9109ee830bab76e50fe070a | 14,816 | py | Python | tests/test_sklearn_adaboost_converter.py | Alexsandruss/sklearn-onnx | b612557615df439e471867a676c9eca8ae4a787c | [
"Apache-2.0"
] | null | null | null | tests/test_sklearn_adaboost_converter.py | Alexsandruss/sklearn-onnx | b612557615df439e471867a676c9eca8ae4a787c | [
"Apache-2.0"
] | null | null | null | tests/test_sklearn_adaboost_converter.py | Alexsandruss/sklearn-onnx | b612557615df439e471867a676c9eca8ae4a787c | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
import unittest
from distutils.version import StrictVersion
import onnx
from onnx.defs import onnx_opset_version
import onnxruntime
from sklearn.ensemble import AdaBoostClassifier, AdaBoostRegressor
from sklearn.linear_model import LinearRegression, LogisticRegression
from sklear... | 37.989744 | 72 | 0.575459 |
f151ba9fd42c248c53d59f417c12ac01cb84144d | 1,842 | py | Python | cat2cat/cat2cat_merge_missing_attributes.py | Filter-Bubble/FormatConversions | 91c313d66edba077462740c1403a705aa1f96df4 | [
"Apache-2.0"
] | 3 | 2019-11-21T13:43:37.000Z | 2021-05-12T20:46:49.000Z | cat2cat/cat2cat_merge_missing_attributes.py | Filter-Bubble/FormatConversions | 91c313d66edba077462740c1403a705aa1f96df4 | [
"Apache-2.0"
] | 3 | 2018-05-22T13:07:43.000Z | 2020-03-14T17:31:15.000Z | cat2cat/cat2cat_merge_missing_attributes.py | Filter-Bubble/FormatConversions | 91c313d66edba077462740c1403a705aa1f96df4 | [
"Apache-2.0"
] | 2 | 2020-03-05T15:55:47.000Z | 2021-05-12T20:46:50.000Z | from lxml import etree
import sys
import os
def get_token_list(mark):
tanch = ''
for token in mark.findall('token_anchor'):
tanch += token.get('t_id')
return tanch
def create_annotation_dict(fname):
parser = etree.XMLParser(ns_clean=True)
correctedcat = etree.parse(fname, parser)
... | 25.583333 | 110 | 0.628664 |
c0e183d007e0c56628138c4999f75ee400cddf70 | 8,314 | py | Python | docs/conf.py | dbierer/linuxforcomposer | fb91a13ac3efa434cd57028676ccf8c95f581df9 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | dbierer/linuxforcomposer | fb91a13ac3efa434cd57028676ccf8c95f581df9 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | dbierer/linuxforcomposer | fb91a13ac3efa434cd57028676ccf8c95f581df9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Simple Email Form documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 17 00:20:22 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | 31.976923 | 96 | 0.71999 |
7b27a4a5af645cc82f74dde8a77d3c05c981addb | 11,152 | py | Python | core/validators.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | core/validators.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | core/validators.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Data type validators
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Python mod... | 20.057554 | 91 | 0.530219 |
733a445a6d70fcc6de04dcd7df49bb39ebc5e0d7 | 855 | py | Python | examples/pytorch/fx/object_detection/maskrcnn/pytorch/maskrcnn_benchmark/modeling/registry.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 567 | 2018-09-13T05:07:49.000Z | 2020-11-23T11:52:11.000Z | examples/pytorch/fx/object_detection/maskrcnn/pytorch/maskrcnn_benchmark/modeling/registry.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 222 | 2018-09-14T10:15:39.000Z | 2020-11-20T22:21:09.000Z | examples/pytorch/fx/object_detection/maskrcnn/pytorch/maskrcnn_benchmark/modeling/registry.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 279 | 2018-09-16T12:40:29.000Z | 2020-11-17T14:22:52.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 38.863636 | 74 | 0.77193 |
6fed441587ae6cabeb2cbb92c508e6ef56486529 | 1,009 | py | Python | src/ocr/helpers.py | FalconMadhab/HTR_notebooks | 4f2438193ba434b413e0d74edf53f0a417ee7429 | [
"MIT"
] | 540 | 2017-02-13T19:53:03.000Z | 2022-03-28T10:04:06.000Z | src/ocr/helpers.py | FalconMadhab/HTR_notebooks | 4f2438193ba434b413e0d74edf53f0a417ee7429 | [
"MIT"
] | 149 | 2018-01-27T09:13:13.000Z | 2022-03-09T06:32:49.000Z | src/ocr/helpers.py | FalconMadhab/HTR_notebooks | 4f2438193ba434b413e0d74edf53f0a417ee7429 | [
"MIT"
] | 207 | 2017-08-06T17:27:17.000Z | 2022-03-12T17:41:46.000Z | # -*- coding: utf-8 -*-
"""
Helper functions for ocr project
"""
import matplotlib.pyplot as plt
import numpy as np
import cv2
SMALL_HEIGHT = 800
def implt(img, cmp=None, t=''):
"""Show image using plt."""
plt.imshow(img, cmap=cmp)
plt.title(t)
plt.show()
def resize(img, height=SMALL_HEIGHT, alway... | 22.422222 | 74 | 0.622398 |
21c9ec6219eb4023b398a7cb546b57205bb908d7 | 1,209 | py | Python | tests/test_storage.py | vsvarunsharma10/pqai | 3ef1351fbc39671916517917de9074a62b092eef | [
"MIT"
] | 17 | 2021-06-23T04:17:06.000Z | 2022-03-25T16:03:49.000Z | tests/test_storage.py | vsvarunsharma10/pqai | 3ef1351fbc39671916517917de9074a62b092eef | [
"MIT"
] | 15 | 2021-06-22T10:14:15.000Z | 2022-03-12T00:58:37.000Z | tests/test_storage.py | vsvarunsharma10/pqai | 3ef1351fbc39671916517917de9074a62b092eef | [
"MIT"
] | 3 | 2021-06-27T18:37:53.000Z | 2022-03-15T04:41:21.000Z | import unittest
import sys
from pathlib import Path
TEST_DIR = Path(__file__).parent
BASE_DIR = TEST_DIR.parent
sys.path.append(str(BASE_DIR.resolve()))
from core.storage import Storage, Folder, JSONDocumentsFolder, MongoCollection
from pymongo import MongoClient
class TestFolderClass(unittest.TestCase):
def test... | 29.487805 | 78 | 0.764268 |
f6299ebaa369a199d4bc01ee88ae8d8f40c398a8 | 3,206 | py | Python | cinder/policies/group_snapshots.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2015-04-02T21:44:36.000Z | 2016-04-29T21:19:04.000Z | cinder/policies/group_snapshots.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 28 | 2017-08-17T14:46:05.000Z | 2022-03-29T12:42:12.000Z | cinder/policies/group_snapshots.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 4 | 2016-01-27T00:25:52.000Z | 2021-03-25T19:54:08.000Z | # Copyright (c) 2017 Huawei Technologies Co., Ltd.
# 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
#
# ... | 30.826923 | 78 | 0.587024 |
cdf69ea2ac2189bd875f9285b11b0e6476622007 | 2,315 | py | Python | p160.py | arpit0891/Project-euler | ab36b33c578578595bb518508fa2fe5862f4a044 | [
"MIT"
] | 1 | 2020-05-14T09:22:32.000Z | 2020-05-14T09:22:32.000Z | p160.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 1 | 2020-03-13T12:42:28.000Z | 2020-05-13T13:26:32.000Z | p160.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 3 | 2020-05-13T13:39:46.000Z | 2020-06-26T10:44:53.000Z | def compute():
ans = factorial_suffix(10**12)
return str(ans)
# The last 5 digits of n!, excluding trailing zeros.
def factorial_suffix(n):
twos = count_factors(n, 2) - count_factors(n, 5) # Always non-negative for every n
# We can reduce 'twos' because there is a cycle: 2^5 = 2^2505 = 32 mod 100000
if twos >= ... | 37.33871 | 178 | 0.700216 |
50722319bed1b414509501bc36f4767e46debd40 | 3,805 | py | Python | tools/config_validator.py | Task-Force-Dagger/Dagger | 56b9ffe3387f74830419a987eed5a0f386674331 | [
"MIT"
] | 14 | 2021-02-11T23:23:21.000Z | 2021-09-08T05:36:47.000Z | tools/config_validator.py | Task-Force-Dagger/Dagger | 56b9ffe3387f74830419a987eed5a0f386674331 | [
"MIT"
] | 130 | 2021-09-09T21:43:16.000Z | 2022-03-30T09:00:37.000Z | tools/config_validator.py | Task-Force-Dagger/Dagger | 56b9ffe3387f74830419a987eed5a0f386674331 | [
"MIT"
] | 11 | 2021-02-18T19:55:51.000Z | 2021-09-01T17:08:47.000Z | #!/usr/bin/env python3
#by PabstMirror - python script to verify all addons using MakePbo's lint checking and extFile Checking
#Arguments (eg: `config_validator.py full`):
#full dump full deRaped config of problem
#skipExt skips checking external file references
import os
import sys
import subprocess
impor... | 28.825758 | 103 | 0.546649 |
92932e05c107b1b8e3849f78aae778b2a464c4a6 | 237 | py | Python | ionyweb/plugin_app/plugin_website_title/forms.py | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 4 | 2015-09-28T10:07:39.000Z | 2019-10-18T20:14:07.000Z | ionyweb/plugin_app/plugin_website_title/forms.py | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 1 | 2021-03-19T21:41:33.000Z | 2021-03-19T21:41:33.000Z | ionyweb/plugin_app/plugin_website_title/forms.py | makinacorpus/ionyweb | 2f18e3dc1fdc86c7e19bae3778e67e28a37567be | [
"BSD-3-Clause"
] | 1 | 2017-10-12T09:25:19.000Z | 2017-10-12T09:25:19.000Z | # -*- coding: utf-8 -*-
import floppyforms as forms
from ionyweb.forms import ModuloModelForm
from models import Plugin_WebsiteTitle
class Plugin_WebsiteTitleForm(ModuloModelForm):
class Meta:
model = Plugin_WebsiteTitle
| 19.75 | 47 | 0.767932 |
c55de89a42b12453b4aeacc3d910a868b242e8e4 | 2,282 | py | Python | utils_xhr/xhr_logger.py | jhfwb/utils_xhr | ad58553c5aef3d3c4e942b95a2676e99618cf7c0 | [
"MIT"
] | null | null | null | utils_xhr/xhr_logger.py | jhfwb/utils_xhr | ad58553c5aef3d3c4e942b95a2676e99618cf7c0 | [
"MIT"
] | null | null | null | utils_xhr/xhr_logger.py | jhfwb/utils_xhr | ad58553c5aef3d3c4e942b95a2676e99618cf7c0 | [
"MIT"
] | null | null | null | import logging
from logging import handlers
from _xhr_tool._annotate import singleObj
@singleObj
class Logger(object):
DEBUG=logging.DEBUG
INFO=logging.INFO
WARNING=logging.WARNING
ERROR=logging.ERROR
CRITICAL=logging.CRITICAL
level_relations = {
'debug': logging.DEBUG,
'info': l... | 39.344828 | 144 | 0.669588 |
11e89315b1a68f90b32eddef67c5defa9d63191a | 1,374 | py | Python | pytorch_agents/common/type_aliases.py | AiForAlpha/pytorch_agents | 0151b16f0a8cf7131cede83c369cbc728435b3c2 | [
"MIT"
] | null | null | null | pytorch_agents/common/type_aliases.py | AiForAlpha/pytorch_agents | 0151b16f0a8cf7131cede83c369cbc728435b3c2 | [
"MIT"
] | null | null | null | pytorch_agents/common/type_aliases.py | AiForAlpha/pytorch_agents | 0151b16f0a8cf7131cede83c369cbc728435b3c2 | [
"MIT"
] | null | null | null | """Common aliases for type hints"""
from enum import Enum
from typing import Any, Callable, Dict, List, NamedTuple, Tuple, Union
import gym
import numpy as np
import torch as th
from pytorch_agents.common import callbacks, vec_env
GymEnv = Union[gym.Env, vec_env.VecEnv]
GymObs = Union[Tuple, Dict[str, Any], np.ndar... | 24.981818 | 91 | 0.737263 |
09bd8d7ee09a6034511b881b6be3e3aefd58c5c2 | 1,550 | py | Python | api/client/test/test_api_list_components_response.py | srishtipithadia/mlx | 2fb61a8840696c7ede77cd600caa8922178ec8b0 | [
"Apache-2.0"
] | null | null | null | api/client/test/test_api_list_components_response.py | srishtipithadia/mlx | 2fb61a8840696c7ede77cd600caa8922178ec8b0 | [
"Apache-2.0"
] | 1 | 2021-09-21T23:31:13.000Z | 2021-09-21T23:31:13.000Z | api/client/test/test_api_list_components_response.py | srishtipithadia/mlx | 2fb61a8840696c7ede77cd600caa8922178ec8b0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 28.703704 | 110 | 0.736774 |
f0a9663dbe00ec7d427d9345d495b9ef6eb54c5c | 2,291 | py | Python | sncosmo/tests/test_magsystems.py | rbiswas4/sncosmo | 813b707044fd21e8e35e7a1cdc650b48417f0ebc | [
"BSD-3-Clause"
] | 1 | 2019-03-27T09:46:46.000Z | 2019-03-27T09:46:46.000Z | sncosmo/tests/test_magsystems.py | jasminelujia/sncosmo | 6ca3be6a52f7a096b874e181c21b93f711610f12 | [
"BSD-3-Clause"
] | null | null | null | sncosmo/tests/test_magsystems.py | jasminelujia/sncosmo | 6ca3be6a52f7a096b874e181c21b93f711610f12 | [
"BSD-3-Clause"
] | 1 | 2019-02-08T16:07:46.000Z | 2019-02-08T16:07:46.000Z | # Licensed under a 3-clause BSD style license - see LICENSES
import math
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
from astropy import units as u
from astropy.utils.data import get_pkg_data_filename
from astropy.tests.helper import remote_data
import pytest
import sncosmo
de... | 29.371795 | 78 | 0.638149 |
bb3aeb09c3aea8c544f490c4a77e8be464aa47c5 | 6,355 | py | Python | Image.py | darius-tan/Fourier-and-Images | b18eb800abbd35984244727a42f2b87596d37019 | [
"MIT"
] | 81 | 2018-07-10T16:32:48.000Z | 2021-11-25T13:23:01.000Z | Image.py | darius-tan/Fourier-and-Images | b18eb800abbd35984244727a42f2b87596d37019 | [
"MIT"
] | null | null | null | Image.py | darius-tan/Fourier-and-Images | b18eb800abbd35984244727a42f2b87596d37019 | [
"MIT"
] | 6 | 2018-07-12T03:43:50.000Z | 2021-11-25T16:15:33.000Z | import cv2
import numpy as np
# Image.find_order(contours)
from bisect import bisect
# Image.find_paths(contours)
from scipy.spatial.distance import cdist
from collections import defaultdict
class Image(object):
def __init__(self, img_loc, shape = None):
self.img = cv2.imread(img_loc)
if shape:
... | 48.884615 | 148 | 0.610071 |
b5a5c3015dc88bb6819d3d28551a185ef11255b5 | 22,373 | py | Python | generate.py | tmercswims/tracker | 7db12af840f358ddde9114ed6f47ed6c1c65807d | [
"MIT"
] | null | null | null | generate.py | tmercswims/tracker | 7db12af840f358ddde9114ed6f47ed6c1c65807d | [
"MIT"
] | null | null | null | generate.py | tmercswims/tracker | 7db12af840f358ddde9114ed6f47ed6c1c65807d | [
"MIT"
] | null | null | null | from math import ceil, floor
import os
from turtle import onclick
import yaml
import re
import dominate
from dominate.tags import *
from dominate.util import raw
from more_itertools import peekable
doc = dominate.document(title="Roundtable Tracker")
doc.set_attribute('lang', 'en')
def to_snake_case(name):
name =... | 64.29023 | 250 | 0.47611 |
61bc7234c7cb3d4c2220c480da50c2cb9845fcc3 | 985 | py | Python | tests/utils/matching/tokens.py | Wallyhs04/httpie | 6bdcdf1eba5a0b15e025388c84e34eecbe0394ee | [
"BSD-3-Clause"
] | 8,454 | 2020-08-13T10:50:14.000Z | 2022-03-31T21:20:51.000Z | tests/utils/matching/tokens.py | Wallyhs04/httpie | 6bdcdf1eba5a0b15e025388c84e34eecbe0394ee | [
"BSD-3-Clause"
] | 415 | 2020-08-13T11:23:54.000Z | 2022-03-31T15:23:42.000Z | tests/utils/matching/tokens.py | Wallyhs04/httpie | 6bdcdf1eba5a0b15e025388c84e34eecbe0394ee | [
"BSD-3-Clause"
] | 591 | 2020-08-13T19:38:58.000Z | 2022-03-28T20:44:19.000Z | from enum import Enum, auto
class Expect(Enum):
"""
Predefined token types we can expect in the output.
"""
REQUEST_HEADERS = auto()
RESPONSE_HEADERS = auto()
BODY = auto()
SEPARATOR = auto()
class ExpectSequence:
"""
Standard combined chunks. These predefined requests and respo... | 18.942308 | 84 | 0.570558 |
6dab36561c8a81a854ae95c23c74fd9613a0ab69 | 44,445 | py | Python | peripheral/pio_11004/config/pio.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | peripheral/pio_11004/config/pio.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | peripheral/pio_11004/config/pio.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | # coding: utf-8
"""*****************************************************************************
* Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | 45.7724 | 192 | 0.682506 |
724528d99cf32ac5c770c052145edb962fa73047 | 2,052 | py | Python | paddlevideo/modeling/framework/recognizers/recognizer_gcn.py | zpc-666/CCF_BDCI_Competition | 9914513248c641aa4b7b70acabfee2ed0c8e2525 | [
"Apache-2.0"
] | 1 | 2022-03-27T04:11:55.000Z | 2022-03-27T04:11:55.000Z | paddlevideo/modeling/framework/recognizers/recognizer_gcn.py | zpc-666/CCF_BDCI_Competition | 9914513248c641aa4b7b70acabfee2ed0c8e2525 | [
"Apache-2.0"
] | 1 | 2021-12-03T07:39:37.000Z | 2022-01-21T03:02:43.000Z | paddlevideo/modeling/framework/recognizers/recognizer_gcn.py | zpc-666/CCF_BDCI_Competition | 9914513248c641aa4b7b70acabfee2ed0c8e2525 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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 b... | 29.314286 | 75 | 0.62232 |
9c949c6dd774cb97de3307c91b07dcd27dbf6213 | 4,526 | py | Python | pyocd/utility/progress.py | laot007/RTTView | 2159ef15455d79c67e93a78219b688e4f1b5454c | [
"MIT"
] | 57 | 2019-01-05T08:55:16.000Z | 2021-06-05T09:28:30.000Z | pyocd/utility/progress.py | laot007/RTTView | 2159ef15455d79c67e93a78219b688e4f1b5454c | [
"MIT"
] | 2 | 2021-11-25T02:34:00.000Z | 2022-01-19T12:04:48.000Z | pyocd/utility/progress.py | laot007/RTTView | 2159ef15455d79c67e93a78219b688e4f1b5454c | [
"MIT"
] | 28 | 2019-03-29T00:47:12.000Z | 2021-04-07T13:58:34.000Z | # pyOCD debugger
# Copyright (c) 2017-2018 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | 30.375839 | 98 | 0.628369 |
35284a0bfd17654d0ad3c398f2e2b8f62fdbebfa | 2,209 | py | Python | A_source_code/carbon/code/general_path.py | vanHoek-dgnm/CARBON-DISC | 3ecd5f4efba5e032d43679ee977064d6b25154a9 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | A_source_code/carbon/code/general_path.py | vanHoek-dgnm/CARBON-DISC | 3ecd5f4efba5e032d43679ee977064d6b25154a9 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | A_source_code/carbon/code/general_path.py | vanHoek-dgnm/CARBON-DISC | 3ecd5f4efba5e032d43679ee977064d6b25154a9 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # ******************************************************
## Copyright 2019, PBL Netherlands Environmental Assessment Agency and Utrecht University.
## Reuse permitted under Gnu Public License, GPL v3.
# ******************************************************
#print("Import general_path.")
import os
import sys
# Read t... | 35.629032 | 106 | 0.646899 |
e60abad02a0202523989712954c54041d5bb5767 | 8,038 | py | Python | torchgeo/models/changestar.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | torchgeo/models/changestar.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | torchgeo/models/changestar.py | remtav/torchgeo | d06b103f81edec4f4e0d13ccd621d318364679a2 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""ChangeStar implementations."""
from typing import Dict, List
import torch
import torch.nn as nn
from einops import rearrange
from torch import Tensor
from torch.nn.modules import Module
from .farseg import FarSeg
# htt... | 35.883929 | 88 | 0.605126 |
67333e31ea3b33ebfa1fc50554f11282f683383b | 226 | py | Python | test_package/tests/unit/composite_calc/test_sigma.py | KMilhan/pytestdocgen | 2af629a23f9f7e315d9943db8554d58b55216b4b | [
"BSD-3-Clause"
] | null | null | null | test_package/tests/unit/composite_calc/test_sigma.py | KMilhan/pytestdocgen | 2af629a23f9f7e315d9943db8554d58b55216b4b | [
"BSD-3-Clause"
] | null | null | null | test_package/tests/unit/composite_calc/test_sigma.py | KMilhan/pytestdocgen | 2af629a23f9f7e315d9943db8554d58b55216b4b | [
"BSD-3-Clause"
] | null | null | null | from mock_package import sigma
def test_sum_of_zero_is_zero():
assert sigma([0 for _ in range(1024)]) == 0
def test_sigma_same_values_with_opposite_sign_returns_zero():
assert sigma([x for x in range(-2, 3)]) == 0
| 22.6 | 61 | 0.730088 |
8b9de8df167f1a5538e0f5e2bd13b52973bbc882 | 553 | py | Python | LeetCode/Leaf-Similar Trees.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 13 | 2021-09-02T07:30:02.000Z | 2022-03-22T19:32:03.000Z | LeetCode/Leaf-Similar Trees.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | null | null | null | LeetCode/Leaf-Similar Trees.py | UtkarshPathrabe/Competitive-Coding | ba322fbb1b88682d56a9b80bdd92a853f1caa84e | [
"MIT"
] | 3 | 2021-08-24T16:06:22.000Z | 2021-09-17T15:39:53.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def leafSimilar(self, root1: TreeNode, root2: TreeNode) -> bool:
def dfs(node):
if node:... | 36.866667 | 68 | 0.555154 |
5d7d9ceb0d3a18f0ab0000e7c6278c513680d794 | 393 | py | Python | mayan/apps/events/urls.py | mbehrle/mayan-edms | 9ebf27d2ea1666eaa36ad6ddc0fb9c6accf5cced | [
"Apache-2.0"
] | null | null | null | mayan/apps/events/urls.py | mbehrle/mayan-edms | 9ebf27d2ea1666eaa36ad6ddc0fb9c6accf5cced | [
"Apache-2.0"
] | 1 | 2022-03-12T01:03:39.000Z | 2022-03-12T01:03:39.000Z | mayan/apps/events/urls.py | mbehrle/mayan-edms | 9ebf27d2ea1666eaa36ad6ddc0fb9c6accf5cced | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from django.conf.urls import patterns, url
urlpatterns = patterns('events.views',
url(r'^all/$', 'events_list', (), 'events_list'),
url(r'^for_object/(?P<app_label>[\w\-]+)/(?P<module_name>[\w\-]+)/(?P<object_id>\d+)/$', 'events_list', (), 'events_for_object'),
url(... | 39.3 | 133 | 0.633588 |
b781d63471b392b299d7a5c2b0916111534b33bd | 4,361 | py | Python | examples/LaTeX/lin_tran_check.py | waldyrious/galgebra | b5eb070340434d030dd737a5656fbf709538b0b1 | [
"BSD-3-Clause"
] | 151 | 2018-09-18T12:30:14.000Z | 2022-03-16T08:02:48.000Z | examples/LaTeX/lin_tran_check.py | waldyrious/galgebra | b5eb070340434d030dd737a5656fbf709538b0b1 | [
"BSD-3-Clause"
] | 454 | 2018-09-19T01:42:30.000Z | 2022-01-18T14:02:00.000Z | examples/LaTeX/lin_tran_check.py | waldyrious/galgebra | b5eb070340434d030dd737a5656fbf709538b0b1 | [
"BSD-3-Clause"
] | 30 | 2019-02-22T08:25:50.000Z | 2022-01-15T05:20:22.000Z | from __future__ import print_function
from sympy import symbols, sin, cos, simplify
from galgebra.ga import Ga
from galgebra.printer import Format, xpdf, Eprint, Print_Function, latex
from galgebra.lt import Symbolic_Matrix
def main():
# Print_Function()
(x, y, z) = xyz = symbols('x,y,z',real=True)
(o3d,... | 26.430303 | 101 | 0.527402 |
bca0457fb6a18be34f58d715ebe31825c2a01ed2 | 4,002 | py | Python | bootstrap.py | iceisblue/HLavalink | 907dce5df3500e1647c7688a6c2cc679ad46142f | [
"MIT"
] | null | null | null | bootstrap.py | iceisblue/HLavalink | 907dce5df3500e1647c7688a6c2cc679ad46142f | [
"MIT"
] | null | null | null | bootstrap.py | iceisblue/HLavalink | 907dce5df3500e1647c7688a6c2cc679ad46142f | [
"MIT"
] | null | null | null | """
Lavalink on Heroku bootstrap script
Credit to diniboy for sed script
"""
from os import system, environ, popen
class LavalinkBootstrap:
"""
Class we're using to get Lavalink working on Heroku
"""
def prepare_version_number(self):
self._version_number = popen(
... | 25.819355 | 283 | 0.528986 |
be6b34f3b88a04fcc174e78e98c88a8fd02d05a0 | 4,033 | py | Python | configs/top_down/darkpose/coco/res50_coco_384x288_dark.py | RuisongZhou/mmpose | a79c649ba07e8a9db24f1467826b9432c09134c6 | [
"Apache-2.0"
] | null | null | null | configs/top_down/darkpose/coco/res50_coco_384x288_dark.py | RuisongZhou/mmpose | a79c649ba07e8a9db24f1467826b9432c09134c6 | [
"Apache-2.0"
] | null | null | null | configs/top_down/darkpose/coco/res50_coco_384x288_dark.py | RuisongZhou/mmpose | a79c649ba07e8a9db24f1467826b9432c09134c6 | [
"Apache-2.0"
] | 1 | 2021-12-29T08:21:50.000Z | 2021-12-29T08:21:50.000Z | log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=5, metric='mAP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = d... | 27.435374 | 79 | 0.624597 |
a941caa64a2e25c78330960136845d11fda67919 | 14,602 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/assign.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/assign.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/assign/assign.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2007-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.... | 40.787709 | 115 | 0.55376 |
e18f0fdd8d95ed6b45bb9c0417a07f72a77561f4 | 434 | py | Python | saleor/lib/python3.7/site-packages/elasticsearch_dsl/__init__.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | 2 | 2019-12-06T15:40:14.000Z | 2020-07-29T21:30:35.000Z | saleor/lib/python3.7/site-packages/elasticsearch_dsl/__init__.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | saleor/lib/python3.7/site-packages/elasticsearch_dsl/__init__.py | cxsper/saleor | 5566ddcdaf8f72ba872eca869798e66eb9cdae44 | [
"BSD-3-Clause"
] | null | null | null | from .query import Q
from .aggs import A
from .function import SF
from .search import Search, MultiSearch
from .field import *
from .document import DocType, MetaField, InnerDoc
from .mapping import Mapping
from .index import Index, IndexTemplate
from .analysis import analyzer, token_filter, char_filter, tokenizer
from... | 28.933333 | 68 | 0.781106 |
d97e036221dd35529dfb303c4595fa0957bbf657 | 303 | py | Python | extensions/.stubs/clrclasses/__clrclasses__/System/Windows/Input/__init__.py | vicwjb/Pycad | 7391cd694b7a91ad9f9964ec95833c1081bc1f84 | [
"MIT"
] | 1 | 2020-03-25T03:27:24.000Z | 2020-03-25T03:27:24.000Z | extensions/.stubs/clrclasses/__clrclasses__/System/Windows/Input/__init__.py | vicwjb/Pycad | 7391cd694b7a91ad9f9964ec95833c1081bc1f84 | [
"MIT"
] | null | null | null | extensions/.stubs/clrclasses/__clrclasses__/System/Windows/Input/__init__.py | vicwjb/Pycad | 7391cd694b7a91ad9f9964ec95833c1081bc1f84 | [
"MIT"
] | null | null | null | from __clrclasses__.System import EventHandler as _n_0_t_0
import typing
class ICommand():
@property
def CanExecuteChanged(self) -> _n_0_t_0:
"""CanExecuteChanged Event: EventHandler"""
def CanExecute(self, parameter: object) -> bool:...
def Execute(self, parameter: object):...
| 33.666667 | 58 | 0.712871 |
aed04b398c1a7b3f1e01f72309400ecf3e4a39ec | 2,546 | py | Python | fix_scriptorium_annis_corpus.py | CopticScriptorium/publish | 4e5896ec203904f798cd34bf24dbbdef18f0140e | [
"Apache-2.0"
] | null | null | null | fix_scriptorium_annis_corpus.py | CopticScriptorium/publish | 4e5896ec203904f798cd34bf24dbbdef18f0140e | [
"Apache-2.0"
] | null | null | null | fix_scriptorium_annis_corpus.py | CopticScriptorium/publish | 4e5896ec203904f798cd34bf24dbbdef18f0140e | [
"Apache-2.0"
] | null | null | null | """
Script to fix common namespace conversion inconsistencies in Pepper relANNIS output
"""
import io, re, os
from shutil import move
def process_file(fname, outname, reps):
with io.open(fname, encoding="utf8") as f:
lines = f.readlines()
with io.open(outname, "w", encoding="utf8", newline="\n") ... | 38 | 113 | 0.58209 |
c76f13ac977019d8e545e6abb0151e4e12a3fe10 | 2,713 | py | Python | examples/advanced/additional_learning.py | vishalbelsare/FEDOT | 3a6f06b29cf2f173008d119f7cb5dc705a45f695 | [
"BSD-3-Clause"
] | null | null | null | examples/advanced/additional_learning.py | vishalbelsare/FEDOT | 3a6f06b29cf2f173008d119f7cb5dc705a45f695 | [
"BSD-3-Clause"
] | null | null | null | examples/advanced/additional_learning.py | vishalbelsare/FEDOT | 3a6f06b29cf2f173008d119f7cb5dc705a45f695 | [
"BSD-3-Clause"
] | null | null | null | from copy import deepcopy
import pandas as pd
from fedot.api.main import Fedot
from fedot.core.operations.atomized_model import AtomizedModel
from fedot.core.pipelines.node import PrimaryNode, SecondaryNode
from fedot.core.pipelines.pipeline import Pipeline
from fedot.core.utils import fedot_project_root
def run_ad... | 44.47541 | 113 | 0.729082 |
9d7bc2e2f40b4a1e9b2aa81e1c7ccde70cdab78f | 406 | py | Python | fstools/util/shapeutil.py | FireByTrial/farmsimtools | 74cf35108b2883b77effd5b55edf4be436287e36 | [
"CC-BY-4.0"
] | null | null | null | fstools/util/shapeutil.py | FireByTrial/farmsimtools | 74cf35108b2883b77effd5b55edf4be436287e36 | [
"CC-BY-4.0"
] | 1 | 2020-11-03T15:39:37.000Z | 2020-11-03T15:39:37.000Z | fstools/util/shapeutil.py | FireByTrial/farmsimtools | 74cf35108b2883b77effd5b55edf4be436287e36 | [
"CC-BY-4.0"
] | null | null | null | import os
from contextlib import contextmanager
def shape_components(shp: str):
return {
ext: os.path.splitext(shp)[0] + f".{ext}" for ext in ['shp', 'shx', 'dbf']
}
@contextmanager
def shape_readers(shp, shx, dbf):
with open(shp, "rb") as spi:
with open(shx, "rb") as sxi:
wi... | 23.882353 | 82 | 0.568966 |
03eb677e8ac96a2b61a48a1e0151ef31de63a2f7 | 6,419 | py | Python | hedwig/models/reg_lstm/__main__.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | 3 | 2019-07-20T15:23:59.000Z | 2021-04-26T02:57:59.000Z | hedwig/models/reg_lstm/__main__.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | null | null | null | hedwig/models/reg_lstm/__main__.py | arjunnlp/hedwig-anlp | b8f6c50d788509bc9e5670caeee3503257d716d0 | [
"Apache-2.0"
] | null | null | null | import logging
import os
import random
from copy import deepcopy
import numpy as np
import torch
from common.evaluate import EvaluatorFactory
from common.train import TrainerFactory
from datasets.aapd import AAPD
from datasets.imdb import IMDB
from datasets.reuters import Reuters
from datasets.yelp2014 import Yelp201... | 36.471591 | 143 | 0.666147 |
3830d822793f3e6d9776be0b4c7a856ce53a9090 | 820 | py | Python | mac/pyobjc-framework-Quartz/Examples/PathDemo/PathDemoController.py | albertz/music-player | d23586f5bf657cbaea8147223be7814d117ae73d | [
"BSD-2-Clause"
] | 132 | 2015-01-01T10:02:42.000Z | 2022-03-09T12:51:01.000Z | mac/pyobjc-framework-Quartz/Examples/PathDemo/PathDemoController.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 6 | 2015-01-06T08:23:19.000Z | 2019-03-14T12:22:06.000Z | mac/pyobjc-framework-Quartz/Examples/PathDemo/PathDemoController.py | mba811/music-player | 7998986b34cfda2244ef622adefb839331b81a81 | [
"BSD-2-Clause"
] | 27 | 2015-02-23T11:51:43.000Z | 2022-03-07T02:34:18.000Z | from Cocoa import *
import objc
class PathDemoController (NSObject):
button = objc.ivar()
popup = objc.ivar()
window = objc.ivar()
demoView = objc.ivar()
def awakeFromNib(self):
# Add the title of your new demo to the END of this array.
titles = [ 'Rectangles',... | 26.451613 | 79 | 0.643902 |
ea686e04c31190b1a4bab046a60c64ab4116e67c | 588 | py | Python | tests/test_get_solution_splitted_algorithm.py | kumagaimasahito/IsingRegisterAllocator | 7d20f56ee035fcaff456ab7641e51bad4b68144f | [
"MIT"
] | 1 | 2021-05-04T06:56:42.000Z | 2021-05-04T06:56:42.000Z | tests/test_get_solution_splitted_algorithm.py | kumagaimasahito/IsingRegisterAllocator | 7d20f56ee035fcaff456ab7641e51bad4b68144f | [
"MIT"
] | 1 | 2021-03-31T14:56:27.000Z | 2021-03-31T14:56:27.000Z | tests/test_get_solution_splitted_algorithm.py | kumagaimasahito/IsingRegisterAllocator | 7d20f56ee035fcaff456ab7641e51bad4b68144f | [
"MIT"
] | null | null | null | from IsingRegisterAllocator import get_solution_splitted_algorithm
from dotenv import load_dotenv
import os
load_dotenv()
AMPLIFY_TOKEN = os.environ.get("AMPLIFY_TOKEN")
def test_get_solution_splitted_algorithm():
list_dependent_variables = [
[1, 2, 3],
[0, 2, 3, 4],
[0, 1, 3, 4],
... | 24.5 | 128 | 0.644558 |
6813b30dff10207a4008f29a2b226cb019af73fb | 17,036 | py | Python | indra_world/assembly/incremental_assembler.py | kkaris/indra_wm_service | d449e5a251428905290433270fd180279a7ae3f7 | [
"BSD-2-Clause"
] | null | null | null | indra_world/assembly/incremental_assembler.py | kkaris/indra_wm_service | d449e5a251428905290433270fd180279a7ae3f7 | [
"BSD-2-Clause"
] | null | null | null | indra_world/assembly/incremental_assembler.py | kkaris/indra_wm_service | d449e5a251428905290433270fd180279a7ae3f7 | [
"BSD-2-Clause"
] | null | null | null | import logging
from copy import deepcopy
import networkx
from collections import defaultdict
from indra.pipeline import AssemblyPipeline
from indra.belief import extend_refinements_graph
from indra.preassembler.refinement import RefinementConfirmationFilter
from indra_world.belief import get_eidos_scorer
from indra_wor... | 44.134715 | 87 | 0.619394 |
69e556791e5b27de7e526a7bc8b054fd3e5a8f94 | 14,633 | py | Python | tests/python/relay/test_external_codegen.py | lhutton1/tvm | e9380e47f0b97c0b98b97f082b075eaa1308038b | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 3 | 2021-05-08T17:04:39.000Z | 2021-07-11T17:40:54.000Z | tests/python/relay/test_external_codegen.py | delldu/tvm | d9ec031ec33e046044fd9521f02ed63213ad07b8 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | tests/python/relay/test_external_codegen.py | delldu/tvm | d9ec031ec33e046044fd9521f02ed63213ad07b8 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | # 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... | 36.766332 | 99 | 0.653318 |
a1aae807e88f6f7ff9e2dfe7ce7681151797d067 | 4,903 | py | Python | tools/mytools/ARIA/src/py/aria/AssignmentFilter.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | tools/mytools/ARIA/src/py/aria/AssignmentFilter.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | tools/mytools/ARIA/src/py/aria/AssignmentFilter.py | fmareuil/Galaxy_test_pasteur | 6f84fb0fc52e3e7dd358623b5da5354c66e16a5f | [
"CC-BY-3.0"
] | null | null | null | """
ARIA -- Ambiguous Restraints for Iterative Assignment
A software for automated NOE assignment
Version 2.3
Copyright (C) Benjamin Bardiaux, Michael Habeck, Therese Malliavin,
Wolfgang Rieping, and Michael Nilges
All rights reserved.
NO W... | 26.502703 | 74 | 0.564348 |
337b392b52a87bc2b253537c115d718e42d456f6 | 4,105 | py | Python | tests/model_builder_unittest.py | hgl71964/dagbo | de198650268baee324bc495899e34531d10369e2 | [
"MIT"
] | null | null | null | tests/model_builder_unittest.py | hgl71964/dagbo | de198650268baee324bc495899e34531d10369e2 | [
"MIT"
] | null | null | null | tests/model_builder_unittest.py | hgl71964/dagbo | de198650268baee324bc495899e34531d10369e2 | [
"MIT"
] | null | null | null | import os
import sys
import math
import warnings
import logging
import unittest
import torch
import numpy as np
from torch import Size, Tensor
from sklearn.metrics import mean_squared_error
import gpytorch
from gpytorch.models.exact_gp import ExactGP
from gpytorch.likelihoods.gaussian_likelihood import GaussianLikelih... | 33.104839 | 116 | 0.667235 |
331aaee9585d91924ceca92cf5f6dee92b149162 | 5,945 | py | Python | azure-devops/azext_devops/devops_sdk/v5_0/token_administration/token_administration_client.py | keithlemon/azure-devops-cli-extension | 4989e5f53650f186e638ccc186605986c76d59bf | [
"MIT"
] | 326 | 2019-04-10T12:38:23.000Z | 2022-03-31T23:07:49.000Z | azure-devops/azext_devops/devops_sdk/v5_0/token_administration/token_administration_client.py | keithlemon/azure-devops-cli-extension | 4989e5f53650f186e638ccc186605986c76d59bf | [
"MIT"
] | 562 | 2019-04-10T07:36:12.000Z | 2022-03-28T07:37:54.000Z | azure-devops/azext_devops/devops_sdk/v5_0/token_administration/token_administration_client.py | keithlemon/azure-devops-cli-extension | 4989e5f53650f186e638ccc186605986c76d59bf | [
"MIT"
] | 166 | 2019-04-10T07:59:40.000Z | 2022-03-16T14:17:13.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... | 61.927083 | 309 | 0.64508 |
567949b094da6f28a43b0ef26f880cb501bc8bff | 2,024 | py | Python | cognigraph/nodes/tests/test_MNE.py | ossadtchi/cognigraph | e616e9fa021720cc62dded649f508500af01853b | [
"MIT"
] | null | null | null | cognigraph/nodes/tests/test_MNE.py | ossadtchi/cognigraph | e616e9fa021720cc62dded649f508500af01853b | [
"MIT"
] | null | null | null | cognigraph/nodes/tests/test_MNE.py | ossadtchi/cognigraph | e616e9fa021720cc62dded649f508500af01853b | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from cognigraph.nodes.processors import MNE
from cognigraph.nodes.sources import FileSource
from cognigraph.nodes.tests.prepare_tests_data import (info, # noqa
fwd_model_path,
... | 25.620253 | 74 | 0.681324 |
8ab9a3962b268edfe034214f44f76498ad6ccb06 | 3,294 | py | Python | capsul/pipeline/custom_nodes/cvfilter_node.py | M40V/capsul | 38331bd47e7b815e6d5162f7973e33088320af6e | [
"CECILL-B"
] | null | null | null | capsul/pipeline/custom_nodes/cvfilter_node.py | M40V/capsul | 38331bd47e7b815e6d5162f7973e33088320af6e | [
"CECILL-B"
] | null | null | null | capsul/pipeline/custom_nodes/cvfilter_node.py | M40V/capsul | 38331bd47e7b815e6d5162f7973e33088320af6e | [
"CECILL-B"
] | null | null | null | '''
:class:`CVFilterNode`
---------------------
'''
from capsul.pipeline.pipeline_nodes import Node
from soma.controller import Controller
import traits.api as traits
import six
import sys
if sys.version_info[0] >= 3:
unicode = str
class CVFilterNode(Node):
'''
This "inert" node filters a list to separ... | 34.673684 | 93 | 0.607165 |
79b8379256bd5fb53f00b6bad947053a6e215138 | 4,520 | py | Python | scripts/regridding/KdTree_IDW.py | PhilipeRLeal/xarray_case_studies | b7771fefde658f0d450cbddd94637ce7936c5f52 | [
"MIT"
] | 1 | 2022-02-22T01:07:31.000Z | 2022-02-22T01:07:31.000Z | scripts/regridding/KdTree_IDW.py | PhilipeRLeal/xarray_case_studies | b7771fefde658f0d450cbddd94637ce7936c5f52 | [
"MIT"
] | null | null | null | scripts/regridding/KdTree_IDW.py | PhilipeRLeal/xarray_case_studies | b7771fefde658f0d450cbddd94637ce7936c5f52 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 10 13:57:10 2020
@author: Philipe_Leal
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os, sys
import geopandas as gpd
import cartopy.crs as ccrs
pd.set_option('display.max_rows', 5000)
pd.set_option('display.max_columns', 5000)
import ... | 23.179487 | 132 | 0.485398 |
5dce39c99ce8ccb5a8fcd3394c666283a32402d8 | 464 | py | Python | src/Shared/Helpers/Transformer.py | DigiChanges/python-experience | 3332d2c4d922a5eb302fa151582a4f63c668a570 | [
"MIT"
] | null | null | null | src/Shared/Helpers/Transformer.py | DigiChanges/python-experience | 3332d2c4d922a5eb302fa151582a4f63c668a570 | [
"MIT"
] | null | null | null | src/Shared/Helpers/Transformer.py | DigiChanges/python-experience | 3332d2c4d922a5eb302fa151582a4f63c668a570 | [
"MIT"
] | null | null | null | import abc
from abc import abstractmethod
from typing import Any
from mongoengine import QuerySet
class Transformer(abc.ABC):
@abstractmethod
def transform(self, data: Any) -> Any:
pass
def handle(self, data: Any) -> Any:
result = None
if isinstance(data, QuerySet):
r... | 22.095238 | 77 | 0.637931 |
745da1aebce0d496a5d99fa2315d385058d635d4 | 1,081 | py | Python | MySQL/mysql_homwork2/core/login.py | MMingLeung/Python_Study | 4ff1d02d2b6dd54e96f7179fa000548936b691e7 | [
"MIT"
] | 3 | 2017-12-27T14:08:17.000Z | 2018-02-10T13:01:08.000Z | MySQL/mysql_homwork2/core/login.py | MMingLeung/Python_Study | 4ff1d02d2b6dd54e96f7179fa000548936b691e7 | [
"MIT"
] | 4 | 2017-05-24T10:37:05.000Z | 2021-06-10T18:35:32.000Z | MySQL/mysql_homwork2/core/login.py | MMingLeung/Python_Study | 4ff1d02d2b6dd54e96f7179fa000548936b691e7 | [
"MIT"
] | 1 | 2018-02-14T19:05:30.000Z | 2018-02-14T19:05:30.000Z | #! -*- coding:utf8 -*-
#! /usr/bin/Python
from lib import db_handler
from lib import permission_manager, user_manager
def login():
'Login module'
while True:
username = input("Please input your username: ")
password = input("Please input your password: ")
db_handler_obj = db_handler.Op... | 28.447368 | 91 | 0.506013 |
01aba7faa50d4f06b3584fb6bde6f748d52459ea | 2,232 | py | Python | api/main.py | enacom/python-bootcamp | e99847442bdd2a6ddbc7fd1d745f7e54950697d9 | [
"MIT"
] | null | null | null | api/main.py | enacom/python-bootcamp | e99847442bdd2a6ddbc7fd1d745f7e54950697d9 | [
"MIT"
] | null | null | null | api/main.py | enacom/python-bootcamp | e99847442bdd2a6ddbc7fd1d745f7e54950697d9 | [
"MIT"
] | 1 | 2022-03-31T02:11:46.000Z | 2022-03-31T02:11:46.000Z | """
ENACOM Python bootcamp
API (interface de programação de aplicações)
para resolução de problemas de otimização.
"""
from typing import Union
from fastapi import FastAPI
from http import HTTPStatus
from api.schemas import (
HealthCheckResponse, OptimizationInput, NotFoundError, OptimizationOutput
)
from api.opti... | 22.545455 | 77 | 0.65009 |
a513c9e024282c0d0ae3c7123b450b84ff729cee | 9,889 | py | Python | python/GafferSceneTest/CameraTest.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneTest/CameraTest.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | python/GafferSceneTest/CameraTest.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | 46.21028 | 204 | 0.668116 |
5d2787bab2999aa1d70545b8bf952d1309eb46e1 | 4,096 | py | Python | sidekick-seq/sidekick/seq/lib_augmenting.py | fabiommendes/sidekick | 993ae7b8496347ad9720d3ff11e10ab946c3a800 | [
"MIT"
] | 32 | 2017-08-10T09:42:51.000Z | 2022-03-18T17:21:26.000Z | sidekick-seq/sidekick/seq/lib_augmenting.py | fabiommendes/sidekick | 993ae7b8496347ad9720d3ff11e10ab946c3a800 | [
"MIT"
] | 1 | 2019-04-10T13:07:45.000Z | 2019-04-18T02:27:47.000Z | sidekick-seq/sidekick/seq/lib_augmenting.py | fabiommendes/sidekick | 993ae7b8496347ad9720d3ff11e10ab946c3a800 | [
"MIT"
] | 5 | 2017-10-10T13:43:23.000Z | 2019-06-18T00:09:15.000Z | import itertools
from collections import deque
from .iter import Iter, generator
from .lib_basic import uncons
from .. import _toolz as toolz
from ..functions import fn
from ..typing import Seq, TYPE_CHECKING, NOT_GIVEN, Func, T
if TYPE_CHECKING:
from .. import api as sk # noqa: F401
@fn.curry(2)
def interpose... | 23.813953 | 75 | 0.552734 |
c8133b3810419e64bb4e045c16fdc7b3d688f3f0 | 5,265 | py | Python | src/schemathesis/lazy.py | PrayagS/schemathesis | 80eb0a689ca197a0999e80b35d5dcbbbd88ddf4b | [
"MIT"
] | 1 | 2021-03-24T08:55:10.000Z | 2021-03-24T08:55:10.000Z | src/schemathesis/lazy.py | PrayagS/schemathesis | 80eb0a689ca197a0999e80b35d5dcbbbd88ddf4b | [
"MIT"
] | null | null | null | src/schemathesis/lazy.py | PrayagS/schemathesis | 80eb0a689ca197a0999e80b35d5dcbbbd88ddf4b | [
"MIT"
] | null | null | null | from inspect import signature
from typing import Any, Callable, Dict, Optional, Union
import attr
import pytest
from _pytest.fixtures import FixtureRequest
from pytest_subtests import SubTests
from .exceptions import InvalidSchema
from .hooks import HookDispatcher, HookScope
from .models import Endpoint
from .schemas... | 39 | 115 | 0.643685 |
f5a12225b2fda3ad4196abb693d28336310cc33f | 2,587 | py | Python | koans/about_dictionaries.py | ProtKsen/learn_python_koans | 557d1eb21fab655a8c8eabaab830aa513871dfc5 | [
"MIT"
] | null | null | null | koans/about_dictionaries.py | ProtKsen/learn_python_koans | 557d1eb21fab655a8c8eabaab830aa513871dfc5 | [
"MIT"
] | null | null | null | koans/about_dictionaries.py | ProtKsen/learn_python_koans | 557d1eb21fab655a8c8eabaab830aa513871dfc5 | [
"MIT"
] | null | null | null | from koans.helpers.comparators import dict_comparator
from koans_plugs import *
def test_create_dictionary_with_literal():
"""
Словарь в Python можно создать с помощью литерала словаря
Литерал словаря – это фигурные скобки: {},
в которых пары ключ-значения разделены запятыми, а ключ от зн... | 23.733945 | 116 | 0.573251 |
151fd8f662713c9856fafbd906e3715fcfb3dfbf | 2,739 | py | Python | test/test_inference/test_stdlib.py | kirat-singh/jedi | 65bc1c117b3175cb4d492484775c3fd7f207bc92 | [
"MIT"
] | 4,213 | 2015-01-02T15:43:22.000Z | 2022-03-31T16:15:01.000Z | test/test_inference/test_stdlib.py | kirat-singh/jedi | 65bc1c117b3175cb4d492484775c3fd7f207bc92 | [
"MIT"
] | 1,392 | 2015-01-02T18:43:39.000Z | 2022-03-27T18:43:59.000Z | test/test_inference/test_stdlib.py | PeterJCLaw/jedi | 070f191f550990c23220d7f209df076178307cf6 | [
"MIT"
] | 525 | 2015-01-02T19:07:31.000Z | 2022-03-13T02:03:20.000Z | """
Tests of various stdlib related things that could not be tested
with "Black Box Tests".
"""
from textwrap import dedent
import pytest
@pytest.mark.parametrize(['letter', 'expected'], [
('n', ['name']),
('s', ['smart']),
])
def test_namedtuple_str(letter, expected, Script):
source = dedent("""\
... | 27.94898 | 76 | 0.6046 |
fcef2328a1ea129a7047b271849e04f43f0b44d3 | 4,965 | py | Python | mkdocs/tests/utils_tests.py | modulardata/mkdocs | 24fffb766e4da64ea5f5afdd7e2452e1f1c66f38 | [
"BSD-2-Clause"
] | null | null | null | mkdocs/tests/utils_tests.py | modulardata/mkdocs | 24fffb766e4da64ea5f5afdd7e2452e1f1c66f38 | [
"BSD-2-Clause"
] | 1 | 2022-02-17T04:10:43.000Z | 2022-02-17T04:10:43.000Z | mkdocs/tests/utils_tests.py | modulardata/mkdocs | 24fffb766e4da64ea5f5afdd7e2452e1f1c66f38 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import os
import unittest
from mkdocs import nav, utils
class UtilsTests(unittest.TestCase):
def test_html_path(self):
expected_results = {
'index.md': 'index.html',
'api-guide.md': 'api-guide/index.htm... | 34.479167 | 79 | 0.534139 |
78d29c861537fe8e5bbd0dffd1de87e08b411e8a | 12,812 | py | Python | youtube_dl/extractor/afreecatv.py | imnx/youtube-dl_rg3-src | e7bfe83e3a000b3cb37bf39a0ab5aaf9e08fc858 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/afreecatv.py | imnx/youtube-dl_rg3-src | e7bfe83e3a000b3cb37bf39a0ab5aaf9e08fc858 | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/afreecatv.py | imnx/youtube-dl_rg3-src | e7bfe83e3a000b3cb37bf39a0ab5aaf9e08fc858 | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_xpath
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
xpath_text,
)
class AfreecaTVIE(InfoExtractor):
IE_NAME = 'afreecatv'
IE_DESC = 'afreecatv.c... | 36.19209 | 162 | 0.470809 |
e339013beb7b92e377cd2ea95ec8b04b9079afcf | 2,830 | py | Python | p2p/tools/asyncio_streams.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | 1 | 2021-04-07T07:33:28.000Z | 2021-04-07T07:33:28.000Z | p2p/tools/asyncio_streams.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | p2p/tools/asyncio_streams.py | dendisuhubdy/trinity | 001664781259c7dd0779a0ef6f822451b608ded4 | [
"MIT"
] | null | null | null | import asyncio
from typing import Any, Dict, Sequence, Tuple
class MemoryProtocol(asyncio.Protocol):
def __init__(self) -> None:
self._closed_event = asyncio.Event()
async def _drain_helper(self) -> None:
pass
@property
async def _closed(self) -> None:
await self._closed_even... | 29.479167 | 96 | 0.660777 |
b41e303f7a872ae71d3a7bdaac2a7483262b50bd | 3,086 | py | Python | project/server/models.py | sebotic/repurpos-backend | 5637d68530947f2ca20e4d3a4257d6128625a95b | [
"MIT"
] | null | null | null | project/server/models.py | sebotic/repurpos-backend | 5637d68530947f2ca20e4d3a4257d6128625a95b | [
"MIT"
] | null | null | null | project/server/models.py | sebotic/repurpos-backend | 5637d68530947f2ca20e4d3a4257d6128625a95b | [
"MIT"
] | 3 | 2018-02-14T19:47:08.000Z | 2018-03-16T09:19:09.000Z | # project/server/models.py
import jwt
import datetime
from project.server import app, db, bcrypt
class User(db.Model):
""" User Model for storing user related details """
__tablename__ = "users"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
email = db.Column(db.String(255), uniq... | 32.145833 | 90 | 0.616008 |
1b362a7b9a1c661a0778644f972d72ce6b4b9c75 | 1,168 | py | Python | python/pyduino_mk/__init__.py | nanpuhaha/pyduino-mk | 6220d243410b883b02493dfa7f605553d62b6678 | [
"MIT"
] | null | null | null | python/pyduino_mk/__init__.py | nanpuhaha/pyduino-mk | 6220d243410b883b02493dfa7f605553d62b6678 | [
"MIT"
] | null | null | null | python/pyduino_mk/__init__.py | nanpuhaha/pyduino-mk | 6220d243410b883b02493dfa7f605553d62b6678 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2015 Nelson Tran
#
# 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, ... | 46.72 | 80 | 0.777397 |
b8f6e673f2e582994ca18da7a4c714781db3633a | 4,114 | py | Python | tensorflow/python/data/service/server_lib.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 8 | 2020-07-29T18:50:45.000Z | 2021-07-25T07:06:43.000Z | tensorflow/python/data/service/server_lib.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 203 | 2019-06-14T23:53:10.000Z | 2022-02-10T02:27:23.000Z | tensorflow/python/data/service/server_lib.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 11 | 2020-05-31T13:14:56.000Z | 2021-12-14T04:39:25.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.162393 | 80 | 0.705882 |
91c9ed0b0b0709e780853d64d8c5ce038299b0ff | 5,385 | py | Python | pkgs/ops-pkg/src/genie/libs/ops/lldp/iosxe/lldp.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/ops-pkg/src/genie/libs/ops/lldp/iosxe/lldp.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/ops-pkg/src/genie/libs/ops/lldp/iosxe/lldp.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | '''
LLDP Genie Ops Object for IOSXE - CLI.
'''
# Genie
from genie.ops.base import Base
from genie.ops.base import Context
class Lldp(Base):
'''LLDP Genie Ops Object'''
def tx_rx_both_enabled(self, item):
'''return True when logic and for tx and rx is True'''
try:
if 'enabled' in ... | 38.191489 | 98 | 0.405571 |
058afa2600787f0ee639e85b2abbe8ea5984e23e | 841 | py | Python | db_migrate.py | pugong/microblog | cb93214de99528370718877ea9f09f041f64a0a4 | [
"BSD-3-Clause"
] | null | null | null | db_migrate.py | pugong/microblog | cb93214de99528370718877ea9f09f041f64a0a4 | [
"BSD-3-Clause"
] | null | null | null | db_migrate.py | pugong/microblog | cb93214de99528370718877ea9f09f041f64a0a4 | [
"BSD-3-Clause"
] | null | null | null | #!flask/bin/python
import imp
from migrate.versioning import api
from app import db
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
migration = SQLALCHEMY_MIGRATE_REPO + '/versions/%03d_migration.py' % (api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) + 1)
tmp_modul... | 49.470588 | 140 | 0.840666 |
86a77505f71b4767b949f34aef3391c6301a2649 | 2,620 | py | Python | main.py | jsanc623/PyBenchTime | 2dd0a0ca499d89968dda9fde36a6c5a2bb5a1460 | [
"MIT"
] | null | null | null | main.py | jsanc623/PyBenchTime | 2dd0a0ca499d89968dda9fde36a6c5a2bb5a1460 | [
"MIT"
] | null | null | null | main.py | jsanc623/PyBenchTime | 2dd0a0ca499d89968dda9fde36a6c5a2bb5a1460 | [
"MIT"
] | null | null | null | from time import time
# Handle the running state of the timer
RUNNING = 1
PAUSED = 0
STOPPED = -1
def get_current_time():
return time()
class Timer:
def __init__(self):
# Resets the timers, laps and summary
self.state = STOPPED # Maintains the state of the timer (RUNNING, PA... | 33.164557 | 98 | 0.567557 |
1990f239cf686835c5c5d14c2fe75fbe295dac43 | 8,730 | py | Python | sunpy/io/fits.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | sunpy/io/fits.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | sunpy/io/fits.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | """
FITS File Reader
Notes
-----
FITS
[1] FITS files allow comments to be attached to every value in the header.
This is implemented in this module as a KEYCOMMENTS dictionary in the
sunpy header. To add a comment to the file on write, add a comment to this
dictionary with the same name as a key in the... | 31.861314 | 79 | 0.60504 |
bcbfee807b2bcae1f08ee4a549ed33a4c5c16767 | 224 | py | Python | src/cos.py | Joebennett19/Monday_morning | 35869a775d51e3c23a05ba2326c174bbe2d2dd58 | [
"MIT"
] | null | null | null | src/cos.py | Joebennett19/Monday_morning | 35869a775d51e3c23a05ba2326c174bbe2d2dd58 | [
"MIT"
] | null | null | null | src/cos.py | Joebennett19/Monday_morning | 35869a775d51e3c23a05ba2326c174bbe2d2dd58 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 15 10:38:34 2021
@author: mm16j2b
"""
import matplotlib.pyplot as plt
import numpy
x=numpy.linspace(0,5,100)
u=numpy.cos(x)
fig, ax1 = plt.subplots()
ax1.plot(x,u)
plt.show() | 14.933333 | 35 | 0.669643 |
5db5e6c2b2c1e2e6b015828d68f86706d1f38083 | 5,425 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 46.367521 | 122 | 0.658249 |
78b144129b9b09504d390fe836de7b506fd90bad | 7,226 | py | Python | imsegm/utils/read_zvi.py | alexlib/pyImSegm | eb75b48066047a9201ba45ad85f816995b35eef4 | [
"BSD-3-Clause"
] | null | null | null | imsegm/utils/read_zvi.py | alexlib/pyImSegm | eb75b48066047a9201ba45ad85f816995b35eef4 | [
"BSD-3-Clause"
] | null | null | null | imsegm/utils/read_zvi.py | alexlib/pyImSegm | eb75b48066047a9201ba45ad85f816995b35eef4 | [
"BSD-3-Clause"
] | 1 | 2019-04-07T09:35:23.000Z | 2019-04-07T09:35:23.000Z | """
https://searchcode.com/codesearch/view/40141634/
read ZVI (Zeiss) image file
- incomplete support
- open uncompressed image from multi item image (Count>0)
- require OleFileIO_PL - a Python module to read MS OLE2 files
http: //www.decalage.info/en/python/olefileio#attachments
.. code-block:: python
>>> impor... | 31.012876 | 78 | 0.628702 |
90f15fa1814c42f47fc39bcdc1700f6f6a464c46 | 7,705 | py | Python | tests/test_dwavesampler.py | wbernoudy/dwave-system | 21be9a868a156cb3d8f929285d67470331da8ad8 | [
"Apache-2.0"
] | 1 | 2021-03-15T19:29:09.000Z | 2021-03-15T19:29:09.000Z | tests/test_dwavesampler.py | wbernoudy/dwave-system | 21be9a868a156cb3d8f929285d67470331da8ad8 | [
"Apache-2.0"
] | null | null | null | tests/test_dwavesampler.py | wbernoudy/dwave-system | 21be9a868a156cb3d8f929285d67470331da8ad8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems 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... | 37.402913 | 119 | 0.559247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.