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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c43af6b0a0ef55b8648c8fefafcc6067e451792 | 379 | py | Python | app/v1/__init__.py | FormatMemory/django_api_backend | 690439ad612598c86c22a837bc0f2e5bea74f2d2 | [
"MIT"
] | null | null | null | app/v1/__init__.py | FormatMemory/django_api_backend | 690439ad612598c86c22a837bc0f2e5bea74f2d2 | [
"MIT"
] | 8 | 2021-03-18T23:26:33.000Z | 2022-03-11T23:44:22.000Z | app/v1/__init__.py | FormatMemory/django_api_backend | 690439ad612598c86c22a837bc0f2e5bea74f2d2 | [
"MIT"
] | null | null | null | import os
ENVIRONMENT = os.environ.get('ENVIRONMENT', 'local')
if ENVIRONMENT == 'production':
import pymysql
pymysql.install_as_MySQLdb()
# else:
# import subprocess
# os.chdir("../")
# bashCommand = "bash scripts/load_sample_data.sh"
# process = subprocess.Popen(bashCommand.split(), stdout=s... | 29.153846 | 77 | 0.691293 | import os
ENVIRONMENT = os.environ.get('ENVIRONMENT', 'local')
if ENVIRONMENT == 'production':
import pymysql
pymysql.install_as_MySQLdb()
| true | true |
1c43b2b5f81f62dcbcaa6b27b888a15112bf38b1 | 1,587 | py | Python | tessled/effects/animations/exploringbox.py | hodgestar/tesseract-control-software | 41f47a4b901a0069f1745c90abe28f0778704b0e | [
"MIT"
] | 2 | 2019-07-13T14:15:30.000Z | 2020-01-04T10:44:47.000Z | tessled/effects/animations/exploringbox.py | hodgestar/tesseract-control-software | 41f47a4b901a0069f1745c90abe28f0778704b0e | [
"MIT"
] | null | null | null | tessled/effects/animations/exploringbox.py | hodgestar/tesseract-control-software | 41f47a4b901a0069f1745c90abe28f0778704b0e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" Exploring Box animation.
Inquisitive pair of cubes of LEDs.
"""
import random
from ..engine import Animation
from ..sprites import Cube
class SpiralPath:
def __init__(self, margin, offset=0.0):
steps_x = 8 - margin[0]
steps_y = 8 - margin[1]
self._max_z... | 26.016393 | 72 | 0.562067 |
import random
from ..engine import Animation
from ..sprites import Cube
class SpiralPath:
def __init__(self, margin, offset=0.0):
steps_x = 8 - margin[0]
steps_y = 8 - margin[1]
self._max_z = 8 - margin[2]
self._xy = []
self._xy += zip([0] * steps_y, range(0, steps_y)... | true | true |
1c43b3c81718370f9fd03f29dbe4c018bc2755bb | 9,171 | py | Python | old/main.py | jandersson/website | 8414f3f5a70f6d919ed8dc77ac535aa52dbc24b0 | [
"Apache-2.0"
] | null | null | null | old/main.py | jandersson/website | 8414f3f5a70f6d919ed8dc77ac535aa52dbc24b0 | [
"Apache-2.0"
] | null | null | null | old/main.py | jandersson/website | 8414f3f5a70f6d919ed8dc77ac535aa52dbc24b0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | 26.277937 | 136 | 0.652928 |
import webapp2
import os
import jinja2
import re
from google.appengine.ext import db
jinja_environment = jinja2.Environment(autoescape=True,
loader=jinja2.FileSystemLoader(os.path.join(os.path.dirname(__file__), 'templates')))
signup_form = """
<html>
<head>
<link type ="text/css" rel ="styleshee... | false | true |
1c43b420d215966a9d094b82adc894d33e04ba72 | 8,997 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/aio/_web_site_management_client.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 58.422078 | 132 | 0.7667 |
from typing import Any, Optional, TYPE_CHECKING
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer
if TYPE_CHECKING:
from azure.core.credentials_async import AsyncTokenCredential
from... | true | true |
1c43b4def4cac1a4ef50874622f19a0f859adacf | 2,826 | py | Python | q2_qemistree/tests/test_process_fingerprint.py | fedarko/q2-qemistree | 611ab6d38fed8f59dda35984e49fa73d7431bc50 | [
"BSD-2-Clause"
] | 1 | 2020-01-22T02:09:11.000Z | 2020-01-22T02:09:11.000Z | q2_qemistree/tests/test_process_fingerprint.py | fedarko/q2-qemistree | 611ab6d38fed8f59dda35984e49fa73d7431bc50 | [
"BSD-2-Clause"
] | null | null | null | q2_qemistree/tests/test_process_fingerprint.py | fedarko/q2-qemistree | 611ab6d38fed8f59dda35984e49fa73d7431bc50 | [
"BSD-2-Clause"
] | 1 | 2021-11-02T02:53:25.000Z | 2021-11-02T02:53:25.000Z | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2018, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 39.25 | 79 | 0.617127 |
from unittest import TestCase, main
from biom import load_table
import pandas as pd
import os
import pkg_resources
import qiime2
from q2_qemistree import CSIDirFmt
from q2_qemistree._process_fingerprint import (collate_fingerprint,
get_feature_smiles)
data = pkg_... | true | true |
1c43b5518f82afd11244e10c06cfe4ffc4dec58b | 1,730 | py | Python | web_server/users/views.py | ColeBoytinck/cmput404-group-project | 133e118fe8453b13f0d5afdf7b8d625eba9e4086 | [
"MIT"
] | null | null | null | web_server/users/views.py | ColeBoytinck/cmput404-group-project | 133e118fe8453b13f0d5afdf7b8d625eba9e4086 | [
"MIT"
] | null | null | null | web_server/users/views.py | ColeBoytinck/cmput404-group-project | 133e118fe8453b13f0d5afdf7b8d625eba9e4086 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseRedirect
from django.contrib.auth import login
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm
from django.contrib.aut... | 32.641509 | 82 | 0.660694 | from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseRedirect
from django.contrib.auth import login
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm
from django.contrib.aut... | true | true |
1c43b5a1abad2c7406e4069e04015d92cba013a2 | 1,523 | py | Python | flax/linen/__init__.py | psc-g/flax | 3ebc3e9751c3d28a78e715ba8a738e56ec1298fb | [
"Apache-2.0"
] | null | null | null | flax/linen/__init__.py | psc-g/flax | 3ebc3e9751c3d28a78e715ba8a738e56ec1298fb | [
"Apache-2.0"
] | null | null | null | flax/linen/__init__.py | psc-g/flax | 3ebc3e9751c3d28a78e715ba8a738e56ec1298fb | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Flax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 43.514286 | 84 | 0.73933 |
from .activation import (celu, elu, gelu, glu, leaky_relu, log_sigmoid,
log_softmax, relu, sigmoid, soft_sign, softmax,
softplus, swish, silu, tanh)
from .attention import (MultiHeadDotProductAttention, SelfAttention,
dot_produc... | true | true |
1c43b639de52cca5596c31b8a080b350134776da | 1,265 | py | Python | pyxt/cmd/tests/test_python.py | millerdev/pyxt | 64034dd17b47a81ebfd0160102919e1f84299a6d | [
"MIT"
] | 3 | 2021-01-10T18:32:15.000Z | 2021-01-12T08:13:29.000Z | pyxt/cmd/tests/test_python.py | millerdev/pyxt | 64034dd17b47a81ebfd0160102919e1f84299a6d | [
"MIT"
] | null | null | null | pyxt/cmd/tests/test_python.py | millerdev/pyxt | 64034dd17b47a81ebfd0160102919e1f84299a6d | [
"MIT"
] | null | null | null | from testil import eq, Regex
from ...process import ProcessError
from ...tests.util import async_test, do_command, FakeEditor, gentest
def test_doc():
@gentest
@async_test
async def test(code, output, command="python"):
editor = FakeEditor(text=code)
result = await do_command(command, edi... | 21.440678 | 69 | 0.484585 | from testil import eq, Regex
from ...process import ProcessError
from ...tests.util import async_test, do_command, FakeEditor, gentest
def test_doc():
@gentest
@async_test
async def test(code, output, command="python"):
editor = FakeEditor(text=code)
result = await do_command(command, edi... | true | true |
1c43b66e895ab1fc296ada51275d11e5502c75e8 | 2,859 | py | Python | artemis/neural_models/text_emotional_clf.py | StanfordGeometryLab/artemis | 2f540173bfd2da3a505715a260834533c3097ac7 | [
"MIT"
] | 254 | 2021-01-20T08:24:53.000Z | 2022-03-30T11:57:23.000Z | artemis/neural_models/text_emotional_clf.py | StanfordGeometryLab/artemis | 2f540173bfd2da3a505715a260834533c3097ac7 | [
"MIT"
] | 11 | 2021-03-26T21:49:22.000Z | 2022-02-27T10:53:52.000Z | artemis/neural_models/text_emotional_clf.py | lyrs/artemis | e4938ef79b504e810e4d3634eab23781b06a926e | [
"MIT"
] | 21 | 2021-01-21T10:31:44.000Z | 2022-03-24T15:54:05.000Z | """
Given an utterance (an optionally an image) guess a distribution over the emotion labels.
The MIT License (MIT)
Originally created in 2020, for Python 3.x
Copyright (c) 2021 Panos Achlioptas (ai.stanford.edu/~optas) & Stanford Geometric Computing Lab
"""
import torch
import torch.nn.functional as F
from torch imp... | 30.414894 | 95 | 0.644281 |
import torch
import torch.nn.functional as F
from torch import nn
from tqdm.notebook import tqdm as tqdm_notebook
from ..utils.stats import AverageMeter
class TextEmotionClassifier(nn.Module):
def __init__(self, text_encoder, clf_head, img_encoder=None):
super(TextEmotionClassifier, self).__init__()
... | true | true |
1c43b6cc0328e741416a790b6fc9f09366c36e66 | 6,270 | py | Python | s64da_benchmark_toolkit/streams.py | a-masterov/s64da-benchmark-toolkit | b1af60c6a1c7d4c62ae9fb5ce04e2c7b59002b0b | [
"MIT"
] | 15 | 2020-03-27T09:40:12.000Z | 2022-03-25T19:55:53.000Z | s64da_benchmark_toolkit/streams.py | a-masterov/s64da-benchmark-toolkit | b1af60c6a1c7d4c62ae9fb5ce04e2c7b59002b0b | [
"MIT"
] | 43 | 2020-03-25T10:03:11.000Z | 2021-06-02T01:15:17.000Z | s64da_benchmark_toolkit/streams.py | a-masterov/s64da-benchmark-toolkit | b1af60c6a1c7d4c62ae9fb5ce04e2c7b59002b0b | [
"MIT"
] | 6 | 2020-10-08T11:32:40.000Z | 2021-11-17T21:20:44.000Z | # -*- coding: utf-8 -*-
import logging
import os
import csv
import re
import time
from collections import namedtuple
from datetime import datetime
from multiprocessing import Manager, Pool
from natsort import natsorted
from pandas.io.formats.style import Styler
import pandas
import yaml
from .db import DB
from .rep... | 33.891892 | 104 | 0.586762 |
import logging
import os
import csv
import re
import time
from collections import namedtuple
from datetime import datetime
from multiprocessing import Manager, Pool
from natsort import natsorted
from pandas.io.formats.style import Styler
import pandas
import yaml
from .db import DB
from .reporting import Reporting... | true | true |
1c43b72ee207df26d65dcf522df11744b18aa4c7 | 2,513 | py | Python | lib/python/treadmill/rest/api/ipa.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/rest/api/ipa.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/rest/api/ipa.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | """Treadmill IPA REST api.
"""
import flask
import flask_restplus as restplus
from flask_restplus import fields
# Disable E0611: No 'name' in module
from treadmill import webutils # pylint: disable=E0611
def handle_api_error(func):
def wrapper(*args):
try:
return func(*args)
except ... | 25.907216 | 74 | 0.566255 |
import flask
import flask_restplus as restplus
from flask_restplus import fields
from treadmill import webutils
def handle_api_error(func):
def wrapper(*args):
try:
return func(*args)
except Exception as e:
return flask.abort(400, {'message': e.message})
return wra... | true | true |
1c43b75a0f460e40be0b6a22f54c96dad9885e8b | 1,340 | py | Python | src/mappening/api/models/user.py | ucladevx/Bmaps-Backend | 8dcbb4ca98d183499e03429b944ec0c7865065a6 | [
"MIT"
] | 3 | 2019-11-22T15:36:16.000Z | 2020-03-13T09:52:45.000Z | src/mappening/api/models/user.py | ucladevx/Mappening-Backend | 8dcbb4ca98d183499e03429b944ec0c7865065a6 | [
"MIT"
] | 59 | 2017-11-03T00:55:20.000Z | 2019-05-09T02:07:50.000Z | src/mappening/api/models/user.py | ucladevx/Mappening-Backend | 8dcbb4ca98d183499e03429b944ec0c7865065a6 | [
"MIT"
] | 2 | 2018-09-15T08:51:12.000Z | 2019-02-03T04:32:09.000Z | from mappening.auth.facebook import facebook_oauth
from mappening.auth.google import google_oauth
from flask import session
from flask_login import UserMixin
# UserMixin provides default implementations for methods user objs should have
class User(UserMixin):
def __init__(self, user_id, active=True, admin=False):... | 30.454545 | 78 | 0.730597 | from mappening.auth.facebook import facebook_oauth
from mappening.auth.google import google_oauth
from flask import session
from flask_login import UserMixin
class User(UserMixin):
def __init__(self, user_id, active=True, admin=False):
self.user_id = user_id
self.active = active
self.admi... | true | true |
1c43b7619606c51986086aabf83c8f3c2b0ac47e | 1,583 | py | Python | kolla/tests/base.py | XieXianbin/kolla | 2548c67ad906ad74edd0517a14cda5ddba0fe2a3 | [
"Apache-2.0"
] | 1 | 2017-03-30T08:09:22.000Z | 2017-03-30T08:09:22.000Z | kolla/tests/base.py | XieXianbin/kolla | 2548c67ad906ad74edd0517a14cda5ddba0fe2a3 | [
"Apache-2.0"
] | 9 | 2019-02-28T09:15:43.000Z | 2021-03-16T14:34:31.000Z | kolla/tests/base.py | XieXianbin/kolla | 2548c67ad906ad74edd0517a14cda5ddba0fe2a3 | [
"Apache-2.0"
] | 3 | 2016-06-16T17:11:06.000Z | 2021-01-24T11:51:21.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 35.177778 | 74 | 0.715098 |
import os
import fixtures
import mock
from oslo_config import cfg
from oslotest import base as oslotest_base
from kolla.common import config as common_config
TESTS_ROOT = os.path.dirname(os.path.abspath(__file__))
class TestCase(oslotest_base.BaseTestCase):
config_file = None
def setUp(self):... | true | true |
1c43b77505fa88b9dd35639fc897dd305727a598 | 439 | py | Python | tests/view/glprograms/test_highlightprogram.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | null | null | null | tests/view/glprograms/test_highlightprogram.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | 1 | 2022-03-13T17:35:35.000Z | 2022-03-13T17:35:35.000Z | tests/view/glprograms/test_highlightprogram.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from blastsight.view.drawables.meshgl import MeshGL
from blastsight.view.glprograms.highlightprogram import HighlightProgram
from tests.view.glprograms.test_meshprogram import TestMeshProgram
class TestHighlightProgram(TestMeshProgram):
@property
def base_program(self):
return H... | 27.4375 | 72 | 0.783599 |
from blastsight.view.drawables.meshgl import MeshGL
from blastsight.view.glprograms.highlightprogram import HighlightProgram
from tests.view.glprograms.test_meshprogram import TestMeshProgram
class TestHighlightProgram(TestMeshProgram):
@property
def base_program(self):
return HighlightProgram()
... | true | true |
1c43b863155dae4837b09f4ac2b454f75e20c5ae | 393 | py | Python | environment/lib/python3.7/site-packages/visions/application/summaries/series/numerical_basic_summary.py | sid-the-coder/Easy-Data-Analysis-With-Pandas | 5ae2a867e5a548e34f28aec89e49c361071b872c | [
"MIT"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | environment/lib/python3.7/site-packages/visions/application/summaries/series/numerical_basic_summary.py | sid-the-coder/Easy-Data-Analysis-With-Pandas | 5ae2a867e5a548e34f28aec89e49c361071b872c | [
"MIT"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | environment/lib/python3.7/site-packages/visions/application/summaries/series/numerical_basic_summary.py | sid-the-coder/Easy-Data-Analysis-With-Pandas | 5ae2a867e5a548e34f28aec89e49c361071b872c | [
"MIT"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import pandas as pd
def numerical_basic_summary(series: pd.Series) -> dict:
"""Summary with basic aggregates
Args:
series: series to summarize
Returns:
A summary of aggregates of `mean`, `std`, `var`, `min`, `max` and `sum`.
"""
aggregates = ["mean", "std", "var", "min", "max", ... | 23.117647 | 80 | 0.608142 | import pandas as pd
def numerical_basic_summary(series: pd.Series) -> dict:
aggregates = ["mean", "std", "var", "min", "max", "sum"]
summary = series.agg(aggregates).to_dict()
return summary
| true | true |
1c43b88f742b955290b3e10e86719a3de9715e92 | 3,878 | py | Python | setup.py | titu1994/lambda_networks_pt | 326006a5ad3dcadc6bfb12da10b5f9530f2305c5 | [
"MIT"
] | 14 | 2021-02-22T00:37:48.000Z | 2022-03-03T02:19:45.000Z | setup.py | titu1994/lambda_networks_pt | 326006a5ad3dcadc6bfb12da10b5f9530f2305c5 | [
"MIT"
] | null | null | null | setup.py | titu1994/lambda_networks_pt | 326006a5ad3dcadc6bfb12da10b5f9530f2305c5 | [
"MIT"
] | 2 | 2021-08-05T01:56:02.000Z | 2022-01-04T10:49:15.000Z | import io
import os
import re
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package arguments
PACKAGE_NAME = "lambda_networks_pt"
DIRECTORY_NAME = "lambda_networks"
SHORT_DESCRIPION = "Pytorch implementation of Lambda Networks (https://arxiv.org/abs/2102.08602)"
URL = "htt... | 27.503546 | 97 | 0.643373 | import io
import os
import re
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
PACKAGE_NAME = "lambda_networks_pt"
DIRECTORY_NAME = "lambda_networks"
SHORT_DESCRIPION = "Pytorch implementation of Lambda Networks (https://arxiv.org/abs/2102.08602)"
URL = "https://github.com/tit... | true | true |
1c43b8cab6d9a2416dab97205ef74dfc1b20fc61 | 975 | py | Python | test/Backend/Iree/Sample/simple_invoke.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | test/Backend/Iree/Sample/simple_invoke.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | test/Backend/Iree/Sample/simple_invoke.py | raikonenfnu/mlir-npcomp | 29e1b2fe89848d58c9bc07e7df7ce651850a5244 | [
"Apache-2.0"
] | null | null | null | # RUN: %PYTHON %s
# TODO: Numpy compiler has bitrotted.
# XFAIL: *
from npcomp.compiler.numpy.backend import iree
from npcomp.compiler.numpy.frontend import *
from npcomp.compiler.numpy import test_config
from npcomp.compiler.numpy.target import *
from npcomp.compiler.utils import logging
# TODO: This should all exis... | 23.214286 | 60 | 0.751795 |
from npcomp.compiler.numpy.backend import iree
from npcomp.compiler.numpy.frontend import *
from npcomp.compiler.numpy import test_config
from npcomp.compiler.numpy.target import *
from npcomp.compiler.utils import logging
from _npcomp import mlir
logging.enable()
def compile_function(f):
fe = ImportFronten... | true | true |
1c43b9414991cdd5cf5b5a0eeb418893db81dd71 | 17,665 | py | Python | static/data/pre_processed/precompute_guides_msgpack_all.py | joshim5/CRISPR-Library-Designer | 2def1e4351c82056587620f7520ec922761ac8f3 | [
"BSD-3-Clause"
] | 17 | 2017-05-24T18:57:56.000Z | 2021-04-18T05:00:10.000Z | static/data/pre_processed/precompute_guides_msgpack_all.py | joshim5/CRISPR-Library-Designer | 2def1e4351c82056587620f7520ec922761ac8f3 | [
"BSD-3-Clause"
] | 10 | 2017-09-11T09:17:51.000Z | 2022-03-11T23:18:50.000Z | static/data/pre_processed/precompute_guides_msgpack_all.py | joshim5/CRISPR-Library-Designer | 2def1e4351c82056587620f7520ec922761ac8f3 | [
"BSD-3-Clause"
] | 5 | 2017-07-28T23:59:51.000Z | 2022-01-04T19:22:22.000Z | import msgpack
import json
import pickle
import os.path
from Queue import PriorityQueue
import re
import doench_score
import azimuth.model_comparison
import numpy as np
import pandas as pd
import csv
from intervaltree import IntervalTree
from multiprocessing import Process
import os
import time
import sys
start_time =... | 36.497934 | 244 | 0.650665 | import msgpack
import json
import pickle
import os.path
from Queue import PriorityQueue
import re
import doench_score
import azimuth.model_comparison
import numpy as np
import pandas as pd
import csv
from intervaltree import IntervalTree
from multiprocessing import Process
import os
import time
import sys
start_time =... | false | true |
1c43baab07473eaec142ec9e6c4ab210843578ac | 654 | py | Python | tests/opcodes/cases/test_assert_cmpge_27.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2021-05-20T16:52:08.000Z | 2021-05-20T16:52:08.000Z | tests/opcodes/cases/test_assert_cmpge_27.py | juztin/pytezos-1 | 7e608ff599d934bdcf129e47db43dbdb8fef9027 | [
"MIT"
] | 1 | 2020-12-30T16:44:56.000Z | 2020-12-30T16:44:56.000Z | tests/opcodes/cases/test_assert_cmpge_27.py | tqtezos/pytezos | a4ac0b022d35d4c9f3062609d8ce09d584b5faa8 | [
"MIT"
] | 1 | 2022-03-20T19:01:00.000Z | 2022-03-20T19:01:00.000Z | from unittest import TestCase
from tests import abspath
from pytezos.repl.interpreter import Interpreter
from pytezos.michelson.converter import michelson_to_micheline
from pytezos.repl.parser import parse_expression
class OpcodeTestassert_cmpge_27(TestCase):
def setUp(self):
self.maxDiff = None
... | 29.727273 | 89 | 0.7263 | from unittest import TestCase
from tests import abspath
from pytezos.repl.interpreter import Interpreter
from pytezos.michelson.converter import michelson_to_micheline
from pytezos.repl.parser import parse_expression
class OpcodeTestassert_cmpge_27(TestCase):
def setUp(self):
self.maxDiff = None
... | true | true |
1c43baccd072765a676117f3125d7e2c4ceb4fb3 | 3,361 | py | Python | entsoe_client/Queries/Congestion/Congestion.py | DarioHett/entsoe-client | bb424fa54966d3be49daa1edb9e0fd40ed00ac15 | [
"MIT"
] | 1 | 2021-10-03T18:11:57.000Z | 2021-10-03T18:11:57.000Z | entsoe_client/Queries/Congestion/Congestion.py | DarioHett/entsoe-client | bb424fa54966d3be49daa1edb9e0fd40ed00ac15 | [
"MIT"
] | 1 | 2021-11-08T16:54:10.000Z | 2021-11-08T16:54:10.000Z | entsoe_client/Queries/Congestion/Congestion.py | DarioHett/entsoe-client | bb424fa54966d3be49daa1edb9e0fd40ed00ac15 | [
"MIT"
] | 1 | 2021-12-04T21:24:53.000Z | 2021-12-04T21:24:53.000Z | from typing import Union
import pandas as pd
from entsoe_client.ParameterTypes import *
from entsoe_client.Queries import Query
class Congestion(Query):
"""4.3 Congestion domain."""
def __init__(
self,
documentType: DocumentType = None,
businessType: BusinessType = None,
in_... | 28.243697 | 82 | 0.628384 | from typing import Union
import pandas as pd
from entsoe_client.ParameterTypes import *
from entsoe_client.Queries import Query
class Congestion(Query):
def __init__(
self,
documentType: DocumentType = None,
businessType: BusinessType = None,
in_Domain: Area = None,
out_... | true | true |
1c43bb10e64934bf4ab7ac1a74d3b67d14c2f676 | 1,060 | py | Python | recon/linker.py | kabirkhan/recon | 19a7c3c644c4e5833fb326958ee090343a45352a | [
"MIT"
] | 4 | 2020-11-27T10:31:14.000Z | 2021-05-21T11:03:08.000Z | recon/linker.py | kabirkhan/recon | 19a7c3c644c4e5833fb326958ee090343a45352a | [
"MIT"
] | null | null | null | recon/linker.py | kabirkhan/recon | 19a7c3c644c4e5833fb326958ee090343a45352a | [
"MIT"
] | 1 | 2020-11-27T10:29:14.000Z | 2020-11-27T10:29:14.000Z | from abc import ABC, abstractmethod
from typing import Iterable, Iterator
from recon.types import Example
from spacy.kb import KnowledgeBase
class BaseEntityLinker(ABC):
@abstractmethod
def __call__(self, examples: Iterable[Example]) -> Iterator[Example]:
raise NotImplementedError
class EntityLinke... | 29.444444 | 73 | 0.633962 | from abc import ABC, abstractmethod
from typing import Iterable, Iterator
from recon.types import Example
from spacy.kb import KnowledgeBase
class BaseEntityLinker(ABC):
@abstractmethod
def __call__(self, examples: Iterable[Example]) -> Iterator[Example]:
raise NotImplementedError
class EntityLinke... | true | true |
1c43bc71e3358de509f11b212de4a7edb29ba5c0 | 1,032 | py | Python | sdk/python/pulumi_azure_native/healthcareapis/v20190916/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/healthcareapis/v20190916/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/healthcareapis/v20190916/__init__.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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! ***
# Export this package's modules as members:
from ._enums import *
from .get_service import *
from .service import *
from ._inputs import *
from . impor... | 30.352941 | 105 | 0.679264 |
# Export this package's modules as members:
from ._enums import *
from .get_service import *
from .service import *
from ._inputs import *
from . import outputs
def _register_module():
import pulumi
from ... import _utilities
class Module(pulumi.runtime.ResourceModule):
_version = _utilities.... | true | true |
1c43bc9888ddbc540bdce99066fbea77b993c8a9 | 436 | py | Python | ProjectEuler/p036.py | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | 1 | 2018-01-30T13:21:30.000Z | 2018-01-30T13:21:30.000Z | ProjectEuler/p036.py | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | null | null | null | ProjectEuler/p036.py | TISparta/competitive-programming-solutions | 31987d4e67bb874bf15653565c6418b5605a20a8 | [
"MIT"
] | 1 | 2018-08-29T13:26:50.000Z | 2018-08-29T13:26:50.000Z |
# Execution time : 0.768209 seconds
# Solution Explanation
# And naive brute-force approach is enough.
import time
width = 40
def solution():
return sum(it for it in range(1000000) if str(it)[:]==str(it)[::-1] and bin(it)[2:]==bin(it)[:1:-1])
if __name__=="__main__":
start_ = time.time()
print(' Answe... | 24.222222 | 104 | 0.614679 |
import time
width = 40
def solution():
return sum(it for it in range(1000000) if str(it)[:]==str(it)[::-1] and bin(it)[2:]==bin(it)[:1:-1])
if __name__=="__main__":
start_ = time.time()
print(' Answer -> %s '.center(width,'-') % ( solution() ))
print(' %f seconds '.center(width,'-') % ( time.ti... | true | true |
1c43bcddd351165d681ed76a72205a2d674eab7f | 4,026 | py | Python | cdtcommon/calculator.py | Just-Jojo/mcoc-v3 | 41c69960c8aff2dbbfd5d11ecc17e7af73e1e305 | [
"MIT"
] | 3 | 2020-08-09T03:03:20.000Z | 2020-12-13T19:01:07.000Z | cdtcommon/calculator.py | Just-Jojo/mcoc-v3 | 41c69960c8aff2dbbfd5d11ecc17e7af73e1e305 | [
"MIT"
] | 19 | 2020-07-24T00:37:51.000Z | 2021-06-18T17:22:14.000Z | cdtcommon/calculator.py | Just-Jojo/mcoc-v3 | 41c69960c8aff2dbbfd5d11ecc17e7af73e1e305 | [
"MIT"
] | 7 | 2020-06-30T20:09:08.000Z | 2021-02-20T03:48:09.000Z | import math
import re
import discord
from redbot.core import checks, commands
from redbot.core.config import Config
from .cdtcommon import CdtCommon
from .cdtembed import Embed
class Calculator(commands.Cog):
"""Calculator"""
def __init__(self, bot):
self.bot = bot
self.thum... | 38.711538 | 118 | 0.544709 | import math
import re
import discord
from redbot.core import checks, commands
from redbot.core.config import Config
from .cdtcommon import CdtCommon
from .cdtembed import Embed
class Calculator(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.thumbnail = "https://www.e... | true | true |
1c43bd3bebe28921f0af5e1ac829a25b07e7fc62 | 10,912 | py | Python | qiskit/pulse/pulse_lib/samplers/decorators.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 3 | 2019-05-19T17:39:38.000Z | 2020-01-28T19:59:18.000Z | qiskit/pulse/pulse_lib/samplers/decorators.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 4 | 2019-05-13T15:28:46.000Z | 2019-12-19T20:47:02.000Z | qiskit/pulse/pulse_lib/samplers/decorators.py | lerongil/qiskit-terra | a25af2a2378bc3d4f5ec73b948d048d1b707454c | [
"Apache-2.0"
] | 1 | 2021-07-07T16:55:41.000Z | 2021-07-07T16:55:41.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 38.971429 | 100 | 0.701155 |
import functools
from typing import Callable
import textwrap
import pydoc
import numpy as np
import qiskit.pulse.commands as commands
from . import strategies
def _update_annotations(discretized_pulse: Callable) -> Callable:
undecorated_annotations = list(discretized_pulse.__annotations__.item... | true | true |
1c43bda4200878b54521164fc598935aec7a8983 | 1,723 | py | Python | script-ZipCodeAudit.py | TomOtt937/Munging-OpenStreetMap | 754985c852ffade06f0957b764135b01def88e67 | [
"MIT"
] | 1 | 2018-04-01T04:02:27.000Z | 2018-04-01T04:02:27.000Z | script-ZipCodeAudit.py | TomOtt937/Munging-OpenStreetMap | 754985c852ffade06f0957b764135b01def88e67 | [
"MIT"
] | null | null | null | script-ZipCodeAudit.py | TomOtt937/Munging-OpenStreetMap | 754985c852ffade06f0957b764135b01def88e67 | [
"MIT"
] | null | null | null | '''
Display a list of zip codes with a count of how often used.
Can also display the id's of nodes and ways with questionable zip codes.
'''
import os
import xml.etree.cElementTree as ET
import pprint
#Update DATADIR and FILENAME as needed
DATADIR = "C:\\Users\\Home\\Documents\\TOM\\Udacity\\Data Analyst Nanodegree\\4... | 30.22807 | 106 | 0.608822 | '''
Display a list of zip codes with a count of how often used.
Can also display the id's of nodes and ways with questionable zip codes.
'''
import os
import xml.etree.cElementTree as ET
import pprint
#Update DATADIR and FILENAME as needed
DATADIR = "C:\\Users\\Home\\Documents\\TOM\\Udacity\\Data Analyst Nanodegree\\4... | false | true |
1c43be1b50051126e52c822f3f6ff0e79cfbfacb | 3,517 | py | Python | simplex_method.py | dvapan/simplex_method | dcc930b092dffa2e55162ea035f43d85572c8568 | [
"MIT"
] | null | null | null | simplex_method.py | dvapan/simplex_method | dcc930b092dffa2e55162ea035f43d85572c8568 | [
"MIT"
] | null | null | null | simplex_method.py | dvapan/simplex_method | dcc930b092dffa2e55162ea035f43d85572c8568 | [
"MIT"
] | null | null | null | # coding=utf-8
__author__ = 'dvapan'
import scipy as sc
import scipy.linalg as lin
import pprint
#
# c = sc.matrix([2.0, 3.0]).transpose()
# A = sc.matrix([[-10.0, 5.0], [6.0, 20.0], [8.0, 15.0]])
# b = sc.matrix([600.0, 600.0, 600.0]).transpose()
# I = [2, 3, 4]
def transform_to_classic(A,b,c):
count_vars = A.... | 29.308333 | 91 | 0.562411 |
__author__ = 'dvapan'
import scipy as sc
import scipy.linalg as lin
import pprint
def transform_to_classic(A,b,c):
count_vars = A.shape[1]
addition_vars = A.shape[0]
count_all_vars = count_vars + addition_vars
_A = sc.resize(A, (A.shape[0], count_all_vars))
_A[:, :count_vars] = A
_A[:,... | true | true |
1c43beac38a9be1ebc96e5f4db2e17a1f69ebb88 | 24,223 | py | Python | python/process_content.py | tdjames1/TMA-data-extraction | 03af0ef3b61df5486f6f061e4e3b62de2e238476 | [
"BSD-3-Clause"
] | null | null | null | python/process_content.py | tdjames1/TMA-data-extraction | 03af0ef3b61df5486f6f061e4e3b62de2e238476 | [
"BSD-3-Clause"
] | 5 | 2021-01-05T12:14:53.000Z | 2021-08-23T09:18:11.000Z | python/process_content.py | tdjames1/TMA-data-extraction | 03af0ef3b61df5486f6f061e4e3b62de2e238476 | [
"BSD-3-Clause"
] | 1 | 2021-02-18T14:59:42.000Z | 2021-02-18T14:59:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""tma_process_content
.. module:: TMA-data-extraction
:synopis: Scripts and functions for extracting weather alert data
from Tanzanian Meteorological Authority "Five days Severe weather
impact-based forecasts" PDFs.
.. moduleauthor: Tamora D. James <t.d.james1@... | 35.054993 | 131 | 0.509103 |
import sys
import argparse
import os
import numpy as np
import numpy.linalg as LA
import bezier
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.path import Path
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import cartopy.io.shapereader as shpreader
import ski... | true | true |
1c43c028cb0bd6fa2468ee77c1143f9fda2d934e | 66,798 | py | Python | nipyapi/registry/apis/bundles_api.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | nipyapi/registry/apis/bundles_api.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | 1 | 2020-03-16T10:02:46.000Z | 2020-03-16T13:37:42.000Z | nipyapi/registry/apis/bundles_api.py | iMajna/nipyapi | 5480af8fe8c6b470249837835cb1a067abb6678e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Apache NiFi Registry REST API
The REST API provides an interface to a registry with operations for saving, versioning, reading NiFi flows and components.
OpenAPI spec version: 0.7.0
Contact: dev@nifi.apache.org
Generated by: https://github.com/swagger-api/swagger-codegen.git
"... | 47.918221 | 357 | 0.600243 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class BundlesApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
s... | true | true |
1c43c04f2267901e6a6439f5190e528fae312122 | 23,661 | py | Python | vt/client.py | kesh-stripe/vt-py | 00ec3743cfc8649c84d3aabc45986177f468bd71 | [
"Apache-2.0"
] | null | null | null | vt/client.py | kesh-stripe/vt-py | 00ec3743cfc8649c84d3aabc45986177f468bd71 | [
"Apache-2.0"
] | null | null | null | vt/client.py | kesh-stripe/vt-py | 00ec3743cfc8649c84d3aabc45986177f468bd71 | [
"Apache-2.0"
] | null | null | null | # Copyright © 2019 The vt-py authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 37.261417 | 91 | 0.711677 |
import aiohttp
import asyncio
import base64
import json
from .error import APIError
from .feed import Feed
from .object import Object
from .iterator import Iterator
from .version import __version__
__all__ = [
'Client',
'ClientResponse',
'url_id']
_API_HOST = 'https://www.virustotal.com'
... | true | true |
1c43c0fdce2f9815a2113123cb5ee97352dd4dee | 1,064 | py | Python | leaderboard/models.py | Fredrik3B/kultspill_backend | 8aad6431f36dad46ef06f4da40f2bc63c6185dd2 | [
"MIT"
] | 1 | 2021-03-11T13:24:55.000Z | 2021-03-11T13:24:55.000Z | leaderboard/models.py | Fredrik3B/kultspill_backend | 8aad6431f36dad46ef06f4da40f2bc63c6185dd2 | [
"MIT"
] | null | null | null | leaderboard/models.py | Fredrik3B/kultspill_backend | 8aad6431f36dad46ef06f4da40f2bc63c6185dd2 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields import PositiveIntegerField
# Create your models here.
class Player(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
playername = models.CharField(max_length=30)
highscore_arcade ... | 31.294118 | 76 | 0.737782 | from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields import PositiveIntegerField
class Player(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
playername = models.CharField(max_length=30)
highscore_arcade = models.PositiveIntegerFi... | true | true |
1c43c29935b123c3b372d55287a8e6ceb0dc1d18 | 1,596 | py | Python | visitor_counter/utils/test_db.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | visitor_counter/utils/test_db.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | visitor_counter/utils/test_db.py | jcromerohdz/FlaskDev | 29539259cba3a0e18c205fb439ee916fb12e5318 | [
"MIT"
] | null | null | null | import os
from flask_sqlalchemy import sqlalchemy
class TestDB:
def __init__(self):
self.db_name = os.environ['DATABASE_NAME'] + '_test'
self.db_host = os.environ['DB_HOST']
self.db_root_password = os.environ['POSTGRES_ROOT_PASSWORD']
if self.db_root_password:
self.db_us... | 38.926829 | 154 | 0.624687 | import os
from flask_sqlalchemy import sqlalchemy
class TestDB:
def __init__(self):
self.db_name = os.environ['DATABASE_NAME'] + '_test'
self.db_host = os.environ['DB_HOST']
self.db_root_password = os.environ['POSTGRES_ROOT_PASSWORD']
if self.db_root_password:
self.db_us... | true | true |
1c43c2a3742fc0d3c893cf6ca0a6a729e50cb27d | 1,672 | py | Python | src/programy/processors/pre/stemming.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/processors/pre/stemming.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | src/programy/processors/pre/stemming.py | NeolithEra/program-y | 8c2396611f30c8095e98ff02988223a641c1a3be | [
"MIT"
] | null | null | null | """
Copyright (c) 2016-2019 Keith Sterling http://www.keithsterling.com
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, m... | 47.771429 | 120 | 0.785885 |
from programy.utils.logging.ylogger import YLogger
from programy.processors.processing import PreProcessor
from programy.nlp.stemming import Stemmer
class StemmingPreProcessor(PreProcessor):
def __init__(self):
PreProcessor.__init__(self)
def process(self, context, word_string):
YLogger.d... | true | true |
1c43c2a3c540a69b7c7955a52ca5fcfac255bb4a | 488 | py | Python | DCNN-Pytorch/shape_testing.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 11 | 2020-06-29T15:21:37.000Z | 2021-04-12T00:42:26.000Z | DCNN-Pytorch/shape_testing.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | null | null | null | DCNN-Pytorch/shape_testing.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 4 | 2019-01-23T23:36:57.000Z | 2021-07-02T00:18:37.000Z | import torch
import deepracing_models.nn_models.Models as M
import time
#net = M.AdmiralNetKinematicPredictor(use_3dconv=False, sequence_length=20, context_length=5)
net = M.AdmiralNetCurvePredictor(use_3dconv=True, context_length=5, params_per_dimension=6)
net = net.cuda(0)
im = torch.rand(64,5,3,66,200)
im = im.cuda(... | 30.5 | 93 | 0.764344 | import torch
import deepracing_models.nn_models.Models as M
import time
net = M.AdmiralNetCurvePredictor(use_3dconv=True, context_length=5, params_per_dimension=6)
net = net.cuda(0)
im = torch.rand(64,5,3,66,200)
im = im.cuda(0)
net=net.eval()
print(net)
print("Running net")
tick = time.time()
out = net(im)
tock = tim... | true | true |
1c43c356ac0bdcea6eceba09900f788aa2884b63 | 1,000 | py | Python | isi_sdk_8_1_1/test/test_storagepool_settings_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_1/test/test_storagepool_settings_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_1/test/test_storagepool_settings_extended.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... | 24.390244 | 112 | 0.734 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from isi_sdk_8_1_1.models.storagepool_settings_extended import StoragepoolSettingsExtended
from isi_sdk_8_1_1.rest import ApiException
class TestStoragepoolSettingsExtended(unittest.TestCase):
def setUp(self):
pass
d... | true | true |
1c43c36c2ada9f5d833ee6c1c64f1c7f9dff279a | 113 | py | Python | dexy/reporters/nodegraph/__init__.py | dsoto/dexy | 0f2090250040c3c54c8481a16de8e476b559e87c | [
"MIT"
] | 136 | 2015-01-06T15:04:47.000Z | 2021-12-21T22:52:41.000Z | dexy/reporters/nodegraph/__init__.py | dsoto/dexy | 0f2090250040c3c54c8481a16de8e476b559e87c | [
"MIT"
] | 13 | 2015-01-26T14:06:58.000Z | 2020-03-27T21:16:10.000Z | dexy/reporters/nodegraph/__init__.py | dsoto/dexy | 0f2090250040c3c54c8481a16de8e476b559e87c | [
"MIT"
] | 34 | 2015-01-02T16:24:53.000Z | 2021-11-27T05:38:30.000Z | import dexy.reporters.nodegraph.d3
import dexy.reporters.nodegraph.text
import dexy.reporters.nodegraph.graphviz
| 28.25 | 40 | 0.867257 | import dexy.reporters.nodegraph.d3
import dexy.reporters.nodegraph.text
import dexy.reporters.nodegraph.graphviz
| true | true |
1c43c4671697267b7379d98f325b8b8c320e8e61 | 3,078 | py | Python | cv/models.py | ezraermy/mkcv | a75ec4144b313d1f92795da582d988634cd4ac7c | [
"MIT"
] | null | null | null | cv/models.py | ezraermy/mkcv | a75ec4144b313d1f92795da582d988634cd4ac7c | [
"MIT"
] | null | null | null | cv/models.py | ezraermy/mkcv | a75ec4144b313d1f92795da582d988634cd4ac7c | [
"MIT"
] | null | null | null | from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
# Create your models here.
class CVmaker(models.Model):
title = models.CharField(max_length=255, null=True)
def __str__(self):
return self.title
class Meta:
verbose_name_plural = 'CVmaker'
class E... | 34.58427 | 110 | 0.649773 | from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
class CVmaker(models.Model):
title = models.CharField(max_length=255, null=True)
def __str__(self):
return self.title
class Meta:
verbose_name_plural = 'CVmaker'
class Employee(models.Model):
... | true | true |
1c43c476a29fee110ef9fc498803191a11545755 | 35,260 | py | Python | meta_dataset/learners/experimental/optimization_learners.py | shikanggao/meta-dataset | 7b1e99009516eda3bbd5e740e178ebc37e2d6767 | [
"Apache-2.0"
] | null | null | null | meta_dataset/learners/experimental/optimization_learners.py | shikanggao/meta-dataset | 7b1e99009516eda3bbd5e740e178ebc37e2d6767 | [
"Apache-2.0"
] | null | null | null | meta_dataset/learners/experimental/optimization_learners.py | shikanggao/meta-dataset | 7b1e99009516eda3bbd5e740e178ebc37e2d6767 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Meta-Dataset 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 ... | 37.71123 | 80 | 0.713244 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import itertools
import gin.tf
from meta_dataset.learners.experimental import base as learner_base
from meta_dataset.models.experimental import reparameterizable_backbones
... | true | true |
1c43c5bfecaed4e7e8964c995dae337fc39d6831 | 126 | py | Python | server/app.py | ZhiShiMao/one | 313c64a47e563fabf9b24e67c52308daff6912e3 | [
"MIT"
] | null | null | null | server/app.py | ZhiShiMao/one | 313c64a47e563fabf9b24e67c52308daff6912e3 | [
"MIT"
] | null | null | null | server/app.py | ZhiShiMao/one | 313c64a47e563fabf9b24e67c52308daff6912e3 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from .api import routers
app = FastAPI()
for router in routers:
app.include_router(router)
| 14 | 30 | 0.753968 | from fastapi import FastAPI
from .api import routers
app = FastAPI()
for router in routers:
app.include_router(router)
| true | true |
1c43c887f1307042e07971b032b7bf4181a998aa | 2,327 | py | Python | ion/services/coi/object_management_service.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 3 | 2016-09-20T09:50:06.000Z | 2018-08-10T01:41:38.000Z | ion/services/coi/object_management_service.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | null | null | null | ion/services/coi/object_management_service.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 2 | 2016-03-16T22:25:49.000Z | 2016-11-26T14:54:21.000Z | #!/usr/bin/env python
__author__ = 'Stephen P. Henrie'
from interface.services.coi.iobject_management_service import BaseObjectManagementService
from pyon.util.containers import is_basic_identifier
from pyon.core.exception import BadRequest, NotFound
from pyon.core.interfaces.interface_util import is_yaml_string_va... | 33.724638 | 89 | 0.647615 |
__author__ = 'Stephen P. Henrie'
from interface.services.coi.iobject_management_service import BaseObjectManagementService
from pyon.util.containers import is_basic_identifier
from pyon.core.exception import BadRequest, NotFound
from pyon.core.interfaces.interface_util import is_yaml_string_valid
class ObjectMan... | true | true |
1c43c91efb5c15cc4a8aef6be89a5b65609db2e1 | 633 | py | Python | src/manage.py | ravihansa/django-multiple-user-auth | 7b6d1c783fc72d30cb7a5bcdf3a262f6ac0772b1 | [
"bzip2-1.0.6"
] | 1 | 2019-10-07T15:26:24.000Z | 2019-10-07T15:26:24.000Z | src/manage.py | ravihansa/django-multiple-user-auth | 7b6d1c783fc72d30cb7a5bcdf3a262f6ac0772b1 | [
"bzip2-1.0.6"
] | null | null | null | src/manage.py | ravihansa/django-multiple-user-auth | 7b6d1c783fc72d30cb7a5bcdf3a262f6ac0772b1 | [
"bzip2-1.0.6"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'multiUserAuth.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ... | 28.772727 | 77 | 0.685624 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'multiUserAuth.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "... | true | true |
1c43c9505cca8a34ef1bc2f328835501e9ee524a | 969 | py | Python | django/contrib/admin/decorators.py | ni-ning/django | 2e7ba6057cfc82a15a22b6021cd60cf307152e2d | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 7 | 2021-03-18T10:21:34.000Z | 2022-02-09T12:54:51.000Z | virtual/lib/python3.6/site-packages/django/contrib/admin/decorators.py | kahenya-anita/Insta-Clone | 4894e959c17170505e73aee6dc497aeb29d55a71 | [
"MIT"
] | 61 | 2021-01-10T12:59:01.000Z | 2021-06-24T09:19:20.000Z | virtual/lib/python3.6/site-packages/django/contrib/admin/decorators.py | kahenya-anita/Insta-Clone | 4894e959c17170505e73aee6dc497aeb29d55a71 | [
"MIT"
] | 7 | 2021-03-15T13:39:20.000Z | 2022-03-29T12:08:21.000Z | def register(*models, site=None):
"""
Register the given model(s) classes and wrapped ModelAdmin class with
admin site:
@register(Author)
class AuthorAdmin(admin.ModelAdmin):
pass
The `site` kwarg is an admin site to use instead of the default admin site.
"""
from django.contri... | 31.258065 | 79 | 0.691434 | def register(*models, site=None):
from django.contrib.admin import ModelAdmin
from django.contrib.admin.sites import AdminSite, site as default_site
def _model_admin_wrapper(admin_class):
if not models:
raise ValueError('At least one model must be passed to register.')
admin_si... | true | true |
1c43cac183ab237cc74013825695bd82ee649cd5 | 1,123 | py | Python | CODE/models/.ipynb_checkpoints/regression-checkpoint.py | happyfuntimegroup/machinelearning | 48b381092736591e4685faafdddc713391922266 | [
"MIT"
] | 1 | 2021-12-07T12:38:33.000Z | 2021-12-07T12:38:33.000Z | CODE/models/regression.py | SelinZ/machinelearning | 105273b2cf5907b23a2ee2b4c076d89f215c38ff | [
"MIT"
] | 12 | 2021-11-30T13:57:48.000Z | 2021-12-07T08:33:18.000Z | CODE/models/regression.py | SelinZ/machinelearning | 105273b2cf5907b23a2ee2b4c076d89f215c38ff | [
"MIT"
] | 1 | 2021-12-07T12:38:00.000Z | 2021-12-07T12:38:00.000Z | def simple_linear(X_train, y_train, X_val, y_val):
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score, mean_absolute_error
model = LinearRegression()
reg = model.fit(X = X_train, y = y_train)
y_pred_val = model.predict(X_val)
print(r2_score(y_val, y_pred_val)... | 34.030303 | 80 | 0.719501 | def simple_linear(X_train, y_train, X_val, y_val):
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score, mean_absolute_error
model = LinearRegression()
reg = model.fit(X = X_train, y = y_train)
y_pred_val = model.predict(X_val)
print(r2_score(y_val, y_pred_val)... | true | true |
1c43cad59151b333a58e3e9bbe73d9671373383e | 6,744 | py | Python | spider/quanmin_anchor.py | AcerFeng/Zhudao | 5a36d0dc7bd718ce03aa476a31b36d7b5230b1b7 | [
"MIT"
] | null | null | null | spider/quanmin_anchor.py | AcerFeng/Zhudao | 5a36d0dc7bd718ce03aa476a31b36d7b5230b1b7 | [
"MIT"
] | null | null | null | spider/quanmin_anchor.py | AcerFeng/Zhudao | 5a36d0dc7bd718ce03aa476a31b36d7b5230b1b7 | [
"MIT"
] | 1 | 2018-09-13T07:41:44.000Z | 2018-09-13T07:41:44.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2018-01-25 00:45:53
# Project: quanmin_anchor
from pyspider.libs.base_handler import *
import pymysql
from datetime import datetime
class Handler(BaseHandler):
headers = {
'Host': 'www.quanmin.tv',
'Connection': 'Keep-Alive',
'A... | 40.626506 | 270 | 0.361358 |
from pyspider.libs.base_handler import *
import pymysql
from datetime import datetime
class Handler(BaseHandler):
headers = {
'Host': 'www.quanmin.tv',
'Connection': 'Keep-Alive',
'Accept-Encoding': 'gzip',
'User-Agent': 'okhttp/3.9.1',
}
crawl_config = {
'ita... | true | true |
1c43cad729128c44137a71f706001f60a8c1b995 | 100 | py | Python | modules/ESP8266/ota.py | ccccmagicboy/MicroPython_fw | d2049bc19e3d5010f5d6d0d17aa13a8693914fbd | [
"MIT"
] | 4 | 2020-02-02T20:12:59.000Z | 2020-07-20T15:44:07.000Z | modules/ESP8266/ota.py | ccccmagicboy/MicroPython_fw | d2049bc19e3d5010f5d6d0d17aa13a8693914fbd | [
"MIT"
] | 10 | 2020-02-18T09:57:04.000Z | 2020-03-04T11:39:17.000Z | modules/ESP8266/ota.py | ccccmagicboy/MicroPython_fw | d2049bc19e3d5010f5d6d0d17aa13a8693914fbd | [
"MIT"
] | null | null | null | import machine
def start():
machine.RTC().memory('yaotaota')
machine.reset()
| 12.5 | 36 | 0.57 | import machine
def start():
machine.RTC().memory('yaotaota')
machine.reset()
| true | true |
1c43cb3436d953b4031542e8c7c48bea06d83265 | 11,467 | py | Python | ovsdbapp/api.py | Sharpeye90/ovsdbapp | 6577bbd5e80cdbe95207211d4d47f43b121f2c86 | [
"Apache-2.0"
] | 34 | 2017-03-24T10:14:33.000Z | 2021-11-19T05:04:54.000Z | ovsdbapp/api.py | Sharpeye90/ovsdbapp | 6577bbd5e80cdbe95207211d4d47f43b121f2c86 | [
"Apache-2.0"
] | 2 | 2021-09-21T13:23:01.000Z | 2021-09-21T13:23:28.000Z | ovsdbapp/api.py | Sharpeye90/ovsdbapp | 6577bbd5e80cdbe95207211d4d47f43b121f2c86 | [
"Apache-2.0"
] | 15 | 2017-07-06T08:00:52.000Z | 2022-03-13T10:29:40.000Z | # Copyright (c) 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 40.235088 | 79 | 0.616552 |
import abc
import contextlib
import threading
class Command(object, metaclass=abc.ABCMeta):
@abc.abstractmethod
def execute(self, **transaction_options):
class Transaction(object, metaclass=abc.ABCMeta):
@abc.abstractmethod
def commit(self):
@abc.abstractmethod
def add(self, ... | true | true |
1c43cb8e251561f5ffb61eedf812dca217fee446 | 524 | py | Python | mysite/ads/views.py | MarcosSalib/mysite_django | 593c9758eeff0b9f536fe6dd2a84a8097ed1850e | [
"MIT"
] | null | null | null | mysite/ads/views.py | MarcosSalib/mysite_django | 593c9758eeff0b9f536fe6dd2a84a8097ed1850e | [
"MIT"
] | null | null | null | mysite/ads/views.py | MarcosSalib/mysite_django | 593c9758eeff0b9f536fe6dd2a84a8097ed1850e | [
"MIT"
] | null | null | null | from django.views import View
from .owner import OwnerListView, OwnerDetailView, OwnerCreateView, OwnerUpdateView, OwnerDeleteView
from .models import Ad
# Create your views here.
class AdListView(OwnerListView):
model = Ad
class AdDetailView(OwnerDetailView):
model = Ad
class AdCreateView(OwnerCreateView)... | 20.96 | 100 | 0.727099 | from django.views import View
from .owner import OwnerListView, OwnerDetailView, OwnerCreateView, OwnerUpdateView, OwnerDeleteView
from .models import Ad
class AdListView(OwnerListView):
model = Ad
class AdDetailView(OwnerDetailView):
model = Ad
class AdCreateView(OwnerCreateView):
model = Ad
fiel... | true | true |
1c43cbadac49f2a6bc13476f9326555357353823 | 1,364 | py | Python | app.py | eshaan7/IPU_GPA_Calculator | 19744864525ceb6de5bd7b6c5c5467870c0281ac | [
"MIT"
] | 6 | 2019-06-12T09:58:14.000Z | 2019-07-28T23:13:28.000Z | app.py | eshaan7/IPU_GPA_Calculator | 19744864525ceb6de5bd7b6c5c5467870c0281ac | [
"MIT"
] | 1 | 2019-06-24T13:57:21.000Z | 2019-06-24T13:57:21.000Z | app.py | Eshaan7/IPU_GPA_Calculator | 19744864525ceb6de5bd7b6c5c5467870c0281ac | [
"MIT"
] | 3 | 2019-06-12T09:58:16.000Z | 2019-08-26T20:08:17.000Z | import os
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
app.secret_key = "66b58fafa6a470f26fd2adc9de14cef2"
''' PWA Stuff '''
# only trigger SSLify if the app is running on Heroku
if 'DYNO' in os.environ:
from flask_sslify import SSLify
sslify = SSLify(app)
@app.route(... | 29.021277 | 88 | 0.691349 | import os
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
app.secret_key = "66b58fafa6a470f26fd2adc9de14cef2"
if 'DYNO' in os.environ:
from flask_sslify import SSLify
sslify = SSLify(app)
@app.route('/sw.js', methods=['GET'])
def sw():
return app.send_static_file('s... | true | true |
1c43cc4bdaf1de7725864b1cb397715c2bbf7991 | 1,517 | py | Python | main.py | yelite/RoomMonitor | 2a1699478aa91ec001fe691c1160e7ac7f7f291d | [
"MIT"
] | null | null | null | main.py | yelite/RoomMonitor | 2a1699478aa91ec001fe691c1160e7ac7f7f291d | [
"MIT"
] | null | null | null | main.py | yelite/RoomMonitor | 2a1699478aa91ec001fe691c1160e7ac7f7f291d | [
"MIT"
] | null | null | null | #coding=utf-8
from datetime import datetime, timedelta
from flask import Flask, render_template, g, jsonify
from model import Data
from helper import gen_unpack_func
from fetch import fetch
app = Flask(__name__)
def get_session():
session = getattr(g, '_session', None)
if session is None:
from db... | 23.338462 | 92 | 0.607779 |
from datetime import datetime, timedelta
from flask import Flask, render_template, g, jsonify
from model import Data
from helper import gen_unpack_func
from fetch import fetch
app = Flask(__name__)
def get_session():
session = getattr(g, '_session', None)
if session is None:
from db import Sessi... | true | true |
1c43ce98895617da79c14c62c224e64da0d934dc | 335 | py | Python | notes/algo-ds-practice/problems/dp/kadane.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 6 | 2020-07-05T05:15:19.000Z | 2021-01-24T20:17:14.000Z | notes/algo-ds-practice/problems/dp/kadane.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | null | null | null | notes/algo-ds-practice/problems/dp/kadane.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 2 | 2020-09-14T06:46:37.000Z | 2021-06-15T09:17:21.000Z | def kadane(arr):
max_global = -1e9
max_local = max_global
for elem in arr:
max_local = max(elem, elem + max_local)
max_global = max(max_global, max_local)
return max_global
def main():
arr = [-2, -3, 4, -1, -2, 1, 5, -3]
ret = kadane(arr)
print(ret)
if __name__ == "__main... | 19.705882 | 47 | 0.576119 | def kadane(arr):
max_global = -1e9
max_local = max_global
for elem in arr:
max_local = max(elem, elem + max_local)
max_global = max(max_global, max_local)
return max_global
def main():
arr = [-2, -3, 4, -1, -2, 1, 5, -3]
ret = kadane(arr)
print(ret)
if __name__ == "__main... | true | true |
1c43d004d4a185b1bfb3c178eb285b0d6056337f | 2,100 | py | Python | llvm-spirv/test/lit.cfg.py | Ralender/sycl | 1fcd1e6d3da10024be92148501aced30ae3aa2be | [
"Apache-2.0"
] | 1 | 2020-09-25T23:33:05.000Z | 2020-09-25T23:33:05.000Z | llvm-spirv/test/lit.cfg.py | Ralender/sycl | 1fcd1e6d3da10024be92148501aced30ae3aa2be | [
"Apache-2.0"
] | null | null | null | llvm-spirv/test/lit.cfg.py | Ralender/sycl | 1fcd1e6d3da10024be92148501aced30ae3aa2be | [
"Apache-2.0"
] | null | null | null | # -*- Python -*-
import lit.formats
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import ToolSubst
from lit.llvm.subst import FindTool
# Configuration file for the 'lit' test runner.
# name: The name of this test suite.
config.name = 'LLVM_SPIRV'
# testFormat: The test format to use to inter... | 33.870968 | 115 | 0.748571 |
import lit.formats
import lit.util
from lit.llvm import llvm_config
from lit.llvm.subst import ToolSubst
from lit.llvm.subst import FindTool
config.name = 'LLVM_SPIRV'
config.test_format = lit.formats.ShTest(True)
config.suffixes = ['.cl', '.ll', '.spt']
config.excludes = ['CMakeLists.txt']
if not config.... | true | true |
1c43d04f11f00dcdcc7312268a8db53989c15597 | 28,424 | py | Python | swift/common/request_helpers.py | Priyanka-Askani/swift | 1ab691f63778008015b34ce004992844acee9968 | [
"Apache-2.0"
] | 1 | 2019-05-25T10:55:58.000Z | 2019-05-25T10:55:58.000Z | swift/common/request_helpers.py | Priyanka-Askani/swift | 1ab691f63778008015b34ce004992844acee9968 | [
"Apache-2.0"
] | 12 | 2015-06-23T23:20:17.000Z | 2016-01-27T00:37:12.000Z | swift/common/request_helpers.py | Priyanka-Askani/swift | 1ab691f63778008015b34ce004992844acee9968 | [
"Apache-2.0"
] | 5 | 2015-06-04T19:00:11.000Z | 2015-12-16T21:04:33.000Z | # Copyright (c) 2010-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 39.587744 | 79 | 0.63369 |
import hashlib
import itertools
import sys
import time
import six
from six.moves.urllib.parse import unquote
from swift.common.header_key_dict import HeaderKeyDict
from swift import gettext_ as _
from swift.common.storage_policy import POLICIES
from swift.common.exceptions import ListingIterError, Seg... | true | true |
1c43d04ffcbbf8f8291758e9efda58952ca0da53 | 1,510 | py | Python | nengolib/stats/ortho.py | ikajic/nengolib | bd30ec38ba656bedb94a267b5f86b51d1cec4954 | [
"MIT"
] | 27 | 2016-01-21T04:11:02.000Z | 2021-11-16T20:41:04.000Z | nengolib/stats/ortho.py | ikajic/nengolib | bd30ec38ba656bedb94a267b5f86b51d1cec4954 | [
"MIT"
] | 178 | 2016-01-21T16:04:34.000Z | 2021-05-01T16:28:02.000Z | nengolib/stats/ortho.py | ikajic/nengolib | bd30ec38ba656bedb94a267b5f86b51d1cec4954 | [
"MIT"
] | 4 | 2019-03-19T18:22:02.000Z | 2021-03-23T16:06:57.000Z | import numpy as np
from scipy.linalg import svd
from nengo.dists import UniformHypersphere
__all__ = ['random_orthogonal']
def random_orthogonal(d, rng=None):
"""Returns a random orthogonal matrix.
Parameters
----------
d : ``integer``
Positive dimension of returned matrix.
rng : :clas... | 26.964286 | 65 | 0.598675 | import numpy as np
from scipy.linalg import svd
from nengo.dists import UniformHypersphere
__all__ = ['random_orthogonal']
def random_orthogonal(d, rng=None):
rng = np.random if rng is None else rng
m = UniformHypersphere(surface=True).sample(d, d, rng=rng)
u, s, v = svd(m)
return np.dot(u, v)
| true | true |
1c43d0671192f23cc6c504e35209d21603155e04 | 5,160 | py | Python | wikimapper/cli.py | jcklie/wikimapper | fadecea085bfa11779e33e94b03a8dcdd2d045a7 | [
"Apache-2.0"
] | 69 | 2019-05-07T02:41:57.000Z | 2022-03-29T09:33:43.000Z | wikimapper/cli.py | jcklie/wikimapper | fadecea085bfa11779e33e94b03a8dcdd2d045a7 | [
"Apache-2.0"
] | 6 | 2019-04-26T11:16:07.000Z | 2021-04-08T15:35:33.000Z | wikimapper/cli.py | jcklie/wikimapper | fadecea085bfa11779e33e94b03a8dcdd2d045a7 | [
"Apache-2.0"
] | 7 | 2020-02-14T20:00:23.000Z | 2021-12-17T09:56:19.000Z | import argparse
import logging
import os
from wikimapper.__version__ import __version__
from wikimapper import download_wikidumps, create_index, WikiMapper
def main():
logging.basicConfig(
level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
description = "Map Wik... | 34.630872 | 193 | 0.650775 | import argparse
import logging
import os
from wikimapper.__version__ import __version__
from wikimapper import download_wikidumps, create_index, WikiMapper
def main():
logging.basicConfig(
level=logging.DEBUG, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
description = "Map Wik... | true | true |
1c43d0fc92643c28afe3143be964b00509b6b818 | 22,725 | py | Python | build/lib/pspnet/pspnet.py | NamTran838P/pspnet-keras | 4005fd7867036e5476bcc694fd2f548a22860d4b | [
"MIT"
] | null | null | null | build/lib/pspnet/pspnet.py | NamTran838P/pspnet-keras | 4005fd7867036e5476bcc694fd2f548a22860d4b | [
"MIT"
] | null | null | null | build/lib/pspnet/pspnet.py | NamTran838P/pspnet-keras | 4005fd7867036e5476bcc694fd2f548a22860d4b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
A Keras/Tensorflow implementation of Pyramid Scene Parsing Networks.
Original paper & code published by Hengshuang Zhao et al. (2017)
"""
from __future__ import print_function
from __future__ import division
from os.path import splitext, join, isfile, isdir
from os import environ, wa... | 45.089286 | 169 | 0.602552 |
from __future__ import print_function
from __future__ import division
from os.path import splitext, join, isfile, isdir
from os import environ, walk
from math import ceil
import argparse
import glob
import fnmatch
import warnings
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets imp... | true | true |
1c43d13e1d7ae8c436ac089155e651917aefd88c | 5,603 | py | Python | Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 12 | 2020-03-04T17:36:12.000Z | 2021-09-26T14:02:49.000Z | Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 1 | 2020-12-09T08:21:11.000Z | 2020-12-09T08:21:11.000Z | Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 3 | 2020-11-18T09:53:42.000Z | 2020-12-17T23:04:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Timothy Dozat
#
# 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 ... | 41.198529 | 164 | 0.622345 |
import numpy as np
import tensorflow as tf
from nparser.neural.models.nlp.parsers.base_parser import BaseParser
class GamaParser(BaseParser):
def __call__(self, vocabs, moving_params=None):
top_recur = super(GamaParser, self).__call__(vocabs, moving_params=moving_params)
int... | true | true |
1c43d18889a0f6900709ccbbcf70196aa6da5678 | 6,236 | py | Python | db_comm_messages.py | seeul8er/DroneBridge_Comm | 156ef546f4680084acc94c34f9ed3caeecf23585 | [
"Apache-2.0"
] | 1 | 2017-11-29T17:06:37.000Z | 2017-11-29T17:06:37.000Z | db_comm_messages.py | seeul8er/DroneBridge_Comm | 156ef546f4680084acc94c34f9ed3caeecf23585 | [
"Apache-2.0"
] | null | null | null | db_comm_messages.py | seeul8er/DroneBridge_Comm | 156ef546f4680084acc94c34f9ed3caeecf23585 | [
"Apache-2.0"
] | null | null | null | import json
import configparser
import binascii
from itertools import chain
import os
tag = 'DB_COMM_MESSAGE: '
PATH_DRONEBRIDGE_TX_SETTINGS = "/boot/DroneBridgeTX.ini"
PATH_DRONEBRIDGE_RX_SETTINGS = "/boot/DroneBridgeRX.ini"
PATH_WBC_SETTINGS = "/boot/wifibroadcast-1.txt"
# As we send it as a single frame we do not ... | 37.341317 | 121 | 0.642559 | import json
import configparser
import binascii
from itertools import chain
import os
tag = 'DB_COMM_MESSAGE: '
PATH_DRONEBRIDGE_TX_SETTINGS = "/boot/DroneBridgeTX.ini"
PATH_DRONEBRIDGE_RX_SETTINGS = "/boot/DroneBridgeRX.ini"
PATH_WBC_SETTINGS = "/boot/wifibroadcast-1.txt"
wbc_settings_blacklist = ["TXMODE", "MAC_RX... | true | true |
1c43d22b596fddf6286a515cf1c8f75f7f260ee6 | 1,209 | py | Python | common/message_forwarder.py | matthewdargan/Cozmo-Capture-the-Flag | 959467ed6ebaeeb42fe60db5905e49963b5d2096 | [
"MIT"
] | null | null | null | common/message_forwarder.py | matthewdargan/Cozmo-Capture-the-Flag | 959467ed6ebaeeb42fe60db5905e49963b5d2096 | [
"MIT"
] | null | null | null | common/message_forwarder.py | matthewdargan/Cozmo-Capture-the-Flag | 959467ed6ebaeeb42fe60db5905e49963b5d2096 | [
"MIT"
] | 1 | 2019-03-05T17:12:07.000Z | 2019-03-05T17:12:07.000Z | import socket
from socket import error as socket_error
from typing import List
def start_connection(ip: str, port: int) -> socket.socket:
"""
Start a connection to a TCP network.
:param ip ip address of the network
:param port port number to forward messages over
:return: socket opened with the i... | 25.1875 | 80 | 0.649297 | import socket
from socket import error as socket_error
from typing import List
def start_connection(ip: str, port: int) -> socket.socket:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except socket_error:
print("Connection failed.")
try:
s.connect((ip, port))
exc... | true | true |
1c43d276031e9a7d2da6cf158bcba42ace6f10b4 | 1,256 | py | Python | hw2/mapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2022-01-05T14:27:20.000Z | 2022-01-05T14:27:20.000Z | hw2/mapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | hw2/mapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
## mapper.py
## Author: Alejandro J. Rojas
## Description: mapper code for HW2.2
import sys
import re
from operator import itemgetter
counts = {}
for line in sys.stdin: ### input comes from STDIN (standard input)
record = re.split(r'\t+', line)
i... | 40.516129 | 102 | 0.454618 |
nts = {}
for line in sys.stdin: neword = re.sub('\-+$','',neword)
neword = re.sub('\!+$','',neword)
neword = re.sub('^\!+','',neword)
neword = re.sub('\'+','\'',neword)
neword = re.sub('\-+','-',n... | false | true |
1c43d37c4d3866bf302fa057cdab10f32428ea99 | 953 | py | Python | cohesity_management_sdk/models/search_job_status_enum.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-09-24T17:35:53.000Z | 2022-03-25T08:08:47.000Z | cohesity_management_sdk/models/search_job_status_enum.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 18 | 2019-03-29T19:32:29.000Z | 2022-01-03T23:16:45.000Z | cohesity_management_sdk/models/search_job_status_enum.py | nick6655/management-sdk-python | 88e792cb83e5c24a22af495b220c145d0c45841d | [
"Apache-2.0"
] | 16 | 2019-02-27T06:54:12.000Z | 2021-11-16T18:10:24.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class SearchJobStatusEnum(object):
"""Implementation of the 'SearchJobStatus' enum.
Specifies the status of the search.
'kJobRunning' indicates that the Job/task is currently running.
'kJobFinished' indicates that the Job/task completed and finis... | 28.029412 | 73 | 0.699895 |
class SearchJobStatusEnum(object):
KJOBRUNNING = 'kJobRunning'
KJOBFINISHED = 'kJobFinished'
KJOBFAILED = 'kJobFailed'
KJOBCANCELED = 'kJobCanceled'
KJOBPAUSED = 'kJobPaused'
| true | true |
1c43d38f9620e64fb551b35cd7d5f96e522ca4e4 | 96 | py | Python | spark_surveymonkey/__init__.py | eferm/spark-surveymonkey | 0912268c9604f32226d29b3d870296d781787a3a | [
"MIT"
] | null | null | null | spark_surveymonkey/__init__.py | eferm/spark-surveymonkey | 0912268c9604f32226d29b3d870296d781787a3a | [
"MIT"
] | null | null | null | spark_surveymonkey/__init__.py | eferm/spark-surveymonkey | 0912268c9604f32226d29b3d870296d781787a3a | [
"MIT"
] | null | null | null | from ._transform import transform_survey
__version__ = '0.1.0'
__all__ = ('transform_survey')
| 16 | 40 | 0.760417 | from ._transform import transform_survey
__version__ = '0.1.0'
__all__ = ('transform_survey')
| true | true |
1c43d4b1509801a52270c7d65891a51a3a8e8637 | 10,527 | py | Python | helpers/shuffleMockCatalog.py | manodeep/yymao-helpers | 4ceffd639f4a10d259146f3f94e0b2415e835f32 | [
"MIT"
] | null | null | null | helpers/shuffleMockCatalog.py | manodeep/yymao-helpers | 4ceffd639f4a10d259146f3f94e0b2415e835f32 | [
"MIT"
] | null | null | null | helpers/shuffleMockCatalog.py | manodeep/yymao-helpers | 4ceffd639f4a10d259146f3f94e0b2415e835f32 | [
"MIT"
] | null | null | null | __all__ = ['shuffleMockCatalog', 'generate_upid']
import warnings
from itertools import izip
import numpy as np
from numpy.lib.recfunctions import rename_fields
def _iter_plateau_in_sorted_array(a):
if len(a):
k = np.where(a[1:] != a[:-1])[0]
k += 1
i = 0
for j in k:
yie... | 36.807692 | 80 | 0.595516 | __all__ = ['shuffleMockCatalog', 'generate_upid']
import warnings
from itertools import izip
import numpy as np
from numpy.lib.recfunctions import rename_fields
def _iter_plateau_in_sorted_array(a):
if len(a):
k = np.where(a[1:] != a[:-1])[0]
k += 1
i = 0
for j in k:
yie... | true | true |
1c43d5f43d8a82eed84cc58c3d38663d541a8be4 | 831 | py | Python | accessible_output/speech/outputs/jaws.py | Timtam/cards-against-humanity | 89ea61b5c9915198b845bbf8a93c3f7827323ceb | [
"MIT"
] | 5 | 2017-04-11T00:18:42.000Z | 2021-08-01T04:27:20.000Z | accessible_output/speech/outputs/jaws.py | Timtam/cards-against-humanity | 89ea61b5c9915198b845bbf8a93c3f7827323ceb | [
"MIT"
] | 47 | 2017-04-27T18:57:27.000Z | 2017-07-16T21:18:28.000Z | accessible_output/speech/outputs/jaws.py | Timtam/cards-against-humanity | 89ea61b5c9915198b845bbf8a93c3f7827323ceb | [
"MIT"
] | 4 | 2018-05-17T12:33:59.000Z | 2022-02-20T16:08:51.000Z | from pywintypes import com_error
import win32gui
import win32com.client
from main import OutputError, ScreenreaderSpeechOutput
class Jaws (ScreenreaderSpeechOutput):
"""Speech output supporting the Jaws for Windows screen reader."""
name = 'Jaws'
def __init__(self, *args, **kwargs):
super (Jaws, self).__init__... | 26.806452 | 124 | 0.718412 | from pywintypes import com_error
import win32gui
import win32com.client
from main import OutputError, ScreenreaderSpeechOutput
class Jaws (ScreenreaderSpeechOutput):
name = 'Jaws'
def __init__(self, *args, **kwargs):
super (Jaws, self).__init__(*args, **kwargs)
try:
self.object = win32com.client.Dispatch("... | true | true |
1c43d7479da3c0f98336c0c943df2ebf50f430e0 | 9,059 | py | Python | algs/nsga_net/utils/utils.py | Beautyya/BenchENA | 5f5491614fc2f00ca26dc29f35f44c334db4718c | [
"MIT"
] | null | null | null | algs/nsga_net/utils/utils.py | Beautyya/BenchENA | 5f5491614fc2f00ca26dc29f35f44c334db4718c | [
"MIT"
] | null | null | null | algs/nsga_net/utils/utils.py | Beautyya/BenchENA | 5f5491614fc2f00ca26dc29f35f44c334db4718c | [
"MIT"
] | null | null | null | import configparser
import os
import platform
import multiprocessing
from compute.file import get_algo_local_dir, get_local_path
import time
import os
import numpy as np
from algs.nsga_net.utils.statusupdatetool import StatusUpdateTool
from algs.nsga_net.genetic.population import Population, Individual
class Utils(ob... | 40.084071 | 114 | 0.535821 | import configparser
import os
import platform
import multiprocessing
from compute.file import get_algo_local_dir, get_local_path
import time
import os
import numpy as np
from algs.nsga_net.utils.statusupdatetool import StatusUpdateTool
from algs.nsga_net.genetic.population import Population, Individual
class Utils(ob... | true | true |
1c43d78b35231ae2efb4db918cbc7bf068cee45e | 4,547 | py | Python | examples/mfa_extraction/fix_mismatch.py | geneing/TensorFlowTTS | 0035ba00fec1b2b1184c8df32646d6a88b01ee5b | [
"Apache-2.0"
] | null | null | null | examples/mfa_extraction/fix_mismatch.py | geneing/TensorFlowTTS | 0035ba00fec1b2b1184c8df32646d6a88b01ee5b | [
"Apache-2.0"
] | null | null | null | examples/mfa_extraction/fix_mismatch.py | geneing/TensorFlowTTS | 0035ba00fec1b2b1184c8df32646d6a88b01ee5b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 TensorFlowTTS Team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 34.44697 | 119 | 0.520563 |
import numpy as np
import os
from tqdm import tqdm
import click
import logging
import sys
logging.basicConfig(
level=logging.DEBUG,
stream=sys.stdout,
format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
)
@click.command()
@click.option("--base_path", default="dump")
@... | true | true |
1c43dadf8de6f9e1d56a4de21587cb982ee0979e | 3,531 | py | Python | profiles_project/settings.py | CGarcia8CG/profiles-resst-api | 2a31f66f875f006a437865999fb5dd63049b14ae | [
"MIT"
] | null | null | null | profiles_project/settings.py | CGarcia8CG/profiles-resst-api | 2a31f66f875f006a437865999fb5dd63049b14ae | [
"MIT"
] | null | null | null | profiles_project/settings.py | CGarcia8CG/profiles-resst-api | 2a31f66f875f006a437865999fb5dd63049b14ae | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 26.548872 | 91 | 0.708581 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'u8&5lcphj96%8)2qf1bj*73i@p_p%_drs0$xrj44@o&6*txak!'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c43db2740e3ecabf360bbab3b871d70e31d5cf0 | 938 | py | Python | composite.py | sloev/photobooth_web | ed2799f30f43dbc8042476c3f9238ffb39ead3b5 | [
"MIT"
] | null | null | null | composite.py | sloev/photobooth_web | ed2799f30f43dbc8042476c3f9238ffb39ead3b5 | [
"MIT"
] | null | null | null | composite.py | sloev/photobooth_web | ed2799f30f43dbc8042476c3f9238ffb39ead3b5 | [
"MIT"
] | null | null | null | from PIL import Image
import os
MAX_COLUMNS = 5
INPUT_DIR = './segments/'
images = [Image.open(INPUT_DIR + filename) for filename in sorted(os.listdir(INPUT_DIR)) if filename.endswith('.png')]
MAX_ROWS = int(len(images)/MAX_COLUMNS) + (1 if len(images) % 20 !=0 else 0)
img_width, img_height = images[0].size
print(M... | 29.3125 | 118 | 0.689765 | from PIL import Image
import os
MAX_COLUMNS = 5
INPUT_DIR = './segments/'
images = [Image.open(INPUT_DIR + filename) for filename in sorted(os.listdir(INPUT_DIR)) if filename.endswith('.png')]
MAX_ROWS = int(len(images)/MAX_COLUMNS) + (1 if len(images) % 20 !=0 else 0)
img_width, img_height = images[0].size
print(M... | true | true |
1c43db677624e3a656cc3cea81f95f7b0f6b3c81 | 353 | py | Python | bitcoin/metrics.py | darbik/work | 7f5640822fc5bbbd4033385d6377878b22785cb2 | [
"MIT"
] | null | null | null | bitcoin/metrics.py | darbik/work | 7f5640822fc5bbbd4033385d6377878b22785cb2 | [
"MIT"
] | 3 | 2016-08-04T18:12:05.000Z | 2016-08-09T16:55:09.000Z | bitcoin/metrics.py | darbik/bitcoin | 7f5640822fc5bbbd4033385d6377878b22785cb2 | [
"MIT"
] | null | null | null | from time import strftime
def get_volume(atmid, price, amount):
volume = (atmid, price, amount)
return volume
def get_time(atmid):
time = (atmid, strftime("%Y-%m-%d %H:%M:%S")) # time format is in UTC
return time
def get_fees(atmid, price, amount):
feesMade = (atmid, (amount / pric... | 16.809524 | 79 | 0.620397 | from time import strftime
def get_volume(atmid, price, amount):
volume = (atmid, price, amount)
return volume
def get_time(atmid):
time = (atmid, strftime("%Y-%m-%d %H:%M:%S"))
return time
def get_fees(atmid, price, amount):
feesMade = (atmid, (amount / price) * 0.05)
return ... | true | true |
1c43dbee4862a38bad9336f123d8fa764442b2cb | 8,629 | py | Python | torch_complex/complex_operation.py | veya2ztn/mltool | 4ed151152845ebe3de128e1f53c478581c1492e4 | [
"IJG"
] | null | null | null | torch_complex/complex_operation.py | veya2ztn/mltool | 4ed151152845ebe3de128e1f53c478581c1492e4 | [
"IJG"
] | null | null | null | torch_complex/complex_operation.py | veya2ztn/mltool | 4ed151152845ebe3de128e1f53c478581c1492e4 | [
"IJG"
] | null | null | null | import numpy as np
import torch
import torch.nn.functional as F
def complex_mul(tensor_1: torch.Tensor,tensor_2: torch.Tensor,mode='cc')-> torch.Tensor:
'''
:param tensor_1(2) [...,2] for real part and image part
'''
if mode == 'cc':
assert tensor_1.shape[-1]==2
assert tensor_2.shape[-1... | 35.510288 | 111 | 0.571909 | import numpy as np
import torch
import torch.nn.functional as F
def complex_mul(tensor_1: torch.Tensor,tensor_2: torch.Tensor,mode='cc')-> torch.Tensor:
if mode == 'cc':
assert tensor_1.shape[-1]==2
assert tensor_2.shape[-1]==2
real1,imag1=tensor_1[...,0],tensor_1[...,1]
real2,imag2... | true | true |
1c43dcbc0e87b2b9319a3efe3dd0e07b164d11cd | 36,802 | py | Python | code_generation/code_generator_online.py | annihilatorrrr/pytgbot | 2f84b11253873f7af1bc7539eb7d93197d51c90c | [
"MIT"
] | 52 | 2015-06-25T15:48:19.000Z | 2021-08-10T20:29:11.000Z | code_generation/code_generator_online.py | annihilatorrrr/pytgbot | 2f84b11253873f7af1bc7539eb7d93197d51c90c | [
"MIT"
] | 16 | 2016-04-12T08:11:30.000Z | 2021-07-22T18:00:07.000Z | code_generation/code_generator_online.py | annihilatorrrr/pytgbot | 2f84b11253873f7af1bc7539eb7d93197d51c90c | [
"MIT"
] | 14 | 2015-06-26T15:29:48.000Z | 2021-08-10T20:29:14.000Z | # -*- coding: utf-8 -*-
from pathlib import Path
from typing import Dict, List, Union
from code_generator import get_type_path
from code_generator_template import clazz, func, get_template, as_types
from code_generator_classes import Clazz, Function, Variable, Type, Import, FunctionClazz
from luckydonaldUtils.files.ba... | 42.496536 | 266 | 0.597386 |
from pathlib import Path
from typing import Dict, List, Union
from code_generator import get_type_path
from code_generator_template import clazz, func, get_template, as_types
from code_generator_classes import Clazz, Function, Variable, Type, Import, FunctionClazz
from luckydonaldUtils.files.basics import mkdir_p
f... | true | true |
1c43ded31ce72ef1e9790a43940975d2e33defc8 | 42 | py | Python | run.py | chrisbarr/bilious-rutabaga | b2d01f03c2cce8342f11139279870156c0ebc9c9 | [
"MIT"
] | null | null | null | run.py | chrisbarr/bilious-rutabaga | b2d01f03c2cce8342f11139279870156c0ebc9c9 | [
"MIT"
] | null | null | null | run.py | chrisbarr/bilious-rutabaga | b2d01f03c2cce8342f11139279870156c0ebc9c9 | [
"MIT"
] | null | null | null | import bucket_lister
bucket_lister.main() | 14 | 20 | 0.857143 | import bucket_lister
bucket_lister.main() | true | true |
1c43df75a6f017476d2000ddd8cfa609911e7416 | 48,453 | py | Python | pymatgen/core/tests/test_structure.py | MahdiDavari/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | null | null | null | pymatgen/core/tests/test_structure.py | MahdiDavari/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | null | null | null | pymatgen/core/tests/test_structure.py | MahdiDavari/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | 1 | 2018-04-09T21:49:14.000Z | 2018-04-09T21:49:14.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals, print_function
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.periodic_table import Element, Specie
from pymatgen.core.composition import C... | 42.878761 | 108 | 0.546137 |
from __future__ import division, unicode_literals, print_function
from pymatgen.util.testing import PymatgenTest
from pymatgen.core.periodic_table import Element, Specie
from pymatgen.core.composition import Composition
from pymatgen.core.operations import SymmOp
from pymatgen.core.structure import IStructure, Str... | true | true |
1c43e0cada49727bd7584ef88bc5aea8845fc86a | 9,387 | py | Python | src/bondora_api/models/api_result_event_log.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 8 | 2019-03-09T20:38:27.000Z | 2021-02-10T20:44:22.000Z | src/bondora_api/models/api_result_event_log.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 1 | 2018-03-06T09:44:21.000Z | 2018-03-06T09:44:21.000Z | src/bondora_api/models/api_result_event_log.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 3 | 2019-06-03T13:44:05.000Z | 2020-11-16T13:17:38.000Z | # coding: utf-8
"""
Bondora API V1
Bondora API version 1
OpenAPI spec version: v1
Contact: investor@bondora.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance ... | 30.086538 | 132 | 0.584425 |
from pprint import pformat
from six import iteritems
import re
class ApiResultEventLog(object):
def __init__(self, page_size=None, page_nr=None, total_count=None, count=None, payload=None, success=None, errors=None):
self.swagger_types = {
'page_size': 'int',
'page_nr': 'int',
... | true | true |
1c43e0f431cee83160cd2cca89590f3101053b77 | 11,888 | py | Python | geoflow1D/GeoModule.py | HerminioTH/GeoFlow1D | 44a5c11e3297827b265c1ea44bb18256b074fa66 | [
"MIT"
] | 2 | 2020-02-10T11:23:16.000Z | 2020-07-01T20:28:57.000Z | geoflow1D/GeoModule.py | HerminioTH/GeoFlow1D | 44a5c11e3297827b265c1ea44bb18256b074fa66 | [
"MIT"
] | null | null | null | geoflow1D/GeoModule.py | HerminioTH/GeoFlow1D | 44a5c11e3297827b265c1ea44bb18256b074fa66 | [
"MIT"
] | null | null | null | def AssemblyStiffnessMatrix(linearSystem, grid, props, uShift=0):
for region in grid.getRegions():
M = props.M.getValue(region)
for e in region.getElements():
dx = e.getLength()
f = e.getFace()
bIndex = f.getBackwardVertex().getIndex() + uShift*grid.getNumberOfVer... | 46.619608 | 117 | 0.597662 | def AssemblyStiffnessMatrix(linearSystem, grid, props, uShift=0):
for region in grid.getRegions():
M = props.M.getValue(region)
for e in region.getElements():
dx = e.getLength()
f = e.getFace()
bIndex = f.getBackwardVertex().getIndex() + uShift*grid.getNumberOfVer... | true | true |
1c43e105b918ef473175c9aefbc7dbf6367f1764 | 22,146 | py | Python | lib/utils/paf_to_pose.py | kacel33/ActionAI_PC | a0528f49ea61cc07d7c1e9a3cd6846e5f50cfae7 | [
"MIT"
] | 1,311 | 2017-03-28T09:24:20.000Z | 2022-03-30T02:43:11.000Z | lib/utils/paf_to_pose.py | kacel33/ActionAI_PC | a0528f49ea61cc07d7c1e9a3cd6846e5f50cfae7 | [
"MIT"
] | 144 | 2017-05-09T16:35:40.000Z | 2022-03-25T03:14:42.000Z | lib/utils/paf_to_pose.py | kacel33/ActionAI_PC | a0528f49ea61cc07d7c1e9a3cd6846e5f50cfae7 | [
"MIT"
] | 437 | 2017-03-30T15:23:14.000Z | 2022-03-25T09:18:50.000Z | import cv2
import numpy as np
import time
from scipy.ndimage.filters import gaussian_filter, maximum_filter
from scipy.ndimage.morphology import generate_binary_structure
from lib.pafprocess import pafprocess
from lib.utils.common import Human, BodyPart, CocoPart, CocoColors, CocoPairsRender
# Heatmap indices to fin... | 54.412776 | 136 | 0.635916 | import cv2
import numpy as np
import time
from scipy.ndimage.filters import gaussian_filter, maximum_filter
from scipy.ndimage.morphology import generate_binary_structure
from lib.pafprocess import pafprocess
from lib.utils.common import Human, BodyPart, CocoPart, CocoColors, CocoPairsRender
joint_to_limb_heatma... | true | true |
1c43e13d8418e3f82d49ce71c1285cf8469339e2 | 387 | py | Python | scp_epub/download/utils.py | elfakyn/scp_epub | 5d0e95d8fa0e11d9ab388c5a4083212c1c857a2f | [
"MIT"
] | 5 | 2020-05-27T15:57:15.000Z | 2021-06-11T01:08:50.000Z | scp_epub/download/utils.py | elfakyn/scp_epub | 5d0e95d8fa0e11d9ab388c5a4083212c1c857a2f | [
"MIT"
] | null | null | null | scp_epub/download/utils.py | elfakyn/scp_epub | 5d0e95d8fa0e11d9ab388c5a4083212c1c857a2f | [
"MIT"
] | 2 | 2020-11-14T04:53:51.000Z | 2021-06-12T19:28:32.000Z | import re
def filter_tags(pages, include_tags=None):
if include_tags is not None:
pages = [
page for page in pages
if 'tags' in page and any(
included_tag in page['tags'] for included_tag in include_tags
)
]
return pages
def normalize_stri... | 21.5 | 77 | 0.578811 | import re
def filter_tags(pages, include_tags=None):
if include_tags is not None:
pages = [
page for page in pages
if 'tags' in page and any(
included_tag in page['tags'] for included_tag in include_tags
)
]
return pages
def normalize_stri... | true | true |
1c43e2186ae5b7bd32f050d7f5b624c8bb3e6dc6 | 12,265 | py | Python | offb_posctl/scripts/MinimumSnapTimeNode.py | SensenLiu/aggrecup | 0c381ee259b388684205c1fa5fc41265a7e849b3 | [
"MIT"
] | null | null | null | offb_posctl/scripts/MinimumSnapTimeNode.py | SensenLiu/aggrecup | 0c381ee259b388684205c1fa5fc41265a7e849b3 | [
"MIT"
] | null | null | null | offb_posctl/scripts/MinimumSnapTimeNode.py | SensenLiu/aggrecup | 0c381ee259b388684205c1fa5fc41265a7e849b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# coding=utf-8
import socket
import numpy as np
from scipy.optimize import minimize
import time
import datetime
import math
import matplotlib.pyplot as plt
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import TwistStamped
from offb_posctl.msg impor... | 45.594796 | 1,439 | 0.609458 |
import socket
import numpy as np
from scipy.optimize import minimize
import time
import datetime
import math
import matplotlib.pyplot as plt
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import TwistStamped
from offb_posctl.msg import controlstate
phi=1.57
ay0=0
vy0=0
y0=0
az0=0
vz0=0
z0... | true | true |
1c43e31b2a6419a99dbce0307a341681e94bc888 | 27,753 | py | Python | toontown/pickatoon/PickAToonOptions.py | cmarshall108/Project-Altis | 7ead614abdb5072ca06323982de461f4e775d1b3 | [
"Apache-2.0"
] | 1 | 2021-02-25T06:02:04.000Z | 2021-02-25T06:02:04.000Z | toontown/pickatoon/PickAToonOptions.py | AnythingTechPro/Project-Altis | 7ead614abdb5072ca06323982de461f4e775d1b3 | [
"Apache-2.0"
] | null | null | null | toontown/pickatoon/PickAToonOptions.py | AnythingTechPro/Project-Altis | 7ead614abdb5072ca06323982de461f4e775d1b3 | [
"Apache-2.0"
] | 2 | 2021-02-25T06:02:05.000Z | 2021-06-19T03:11:22.000Z | '''
Created on Apr 2, 2016
@author: Drew
'''
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import Wait, Func, Sequence, LerpColorScaleInterval, Parallel, LerpScaleInterval
from direct.showbase.DirectObject import DirectObject
from panda3d.core import TransparencyAttrib, Point3, Vec4, TextNode... | 49.033569 | 431 | 0.644723 |
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import Wait, Func, Sequence, LerpColorScaleInterval, Parallel, LerpScaleInterval
from direct.showbase.DirectObject import DirectObject
from panda3d.core import TransparencyAttrib, Point3, Vec4, TextNode, Vec3
from toontown.toonbase import TTLocali... | true | true |
1c43e36be51bc3b9156c0575a20c0ca5254421ba | 1,708 | py | Python | thirdParty/lxml/__init__.py | knittledan/Location_Search_Prediction | c96e3bfc0c73b646b9a7620bb1655285458fb20d | [
"MIT"
] | null | null | null | thirdParty/lxml/__init__.py | knittledan/Location_Search_Prediction | c96e3bfc0c73b646b9a7620bb1655285458fb20d | [
"MIT"
] | null | null | null | thirdParty/lxml/__init__.py | knittledan/Location_Search_Prediction | c96e3bfc0c73b646b9a7620bb1655285458fb20d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#----------------------------------------------------------------------------------------
# __init__.py initialization file for PIL
#----------------------------------------------------------------------------------------
import os
import sys
import platform
#----------------------------------... | 30.5 | 89 | 0.384075 |
import os
import sys
import platform
kMac = 0
kLinux = 1
kWindows = 2
currentDir = os.path.dirname(os.path.realpath(__file__))
version = sys.version_info[:2]
if version == (2, 7):
lxmlVersion = "lxml_py27"
if version == (3, 2):
lxmlVersion = "lxml_py32"
def getOs():
name = platform.sy... | true | true |
1c43e4d4ab4dc301594d8265fd0f7be7719b47ae | 2,611 | py | Python | examples/plot_samples.py | AWehrhahn/exoplanet_transit_snr | f1bdaddb89e1c8b819651bcd2d80ed95d2a1fc0f | [
"MIT"
] | null | null | null | examples/plot_samples.py | AWehrhahn/exoplanet_transit_snr | f1bdaddb89e1c8b819651bcd2d80ed95d2a1fc0f | [
"MIT"
] | null | null | null | examples/plot_samples.py | AWehrhahn/exoplanet_transit_snr | f1bdaddb89e1c8b819651bcd2d80ed95d2a1fc0f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import corner
import emcee
import matplotlib.pyplot as plt
import numpy as np
from astropy import units as u
from exoorbit.orbit import Orbit
from exoplanet_transit_snr.stellardb import StellarDb
star, planet = "WASP-107", "b"
datasets = {50: "WASP-107b_SNR50", 100: "WASP-107b_SNR100", 200: "W... | 30.717647 | 105 | 0.640368 |
import corner
import emcee
import matplotlib.pyplot as plt
import numpy as np
from astropy import units as u
from exoorbit.orbit import Orbit
from exoplanet_transit_snr.stellardb import StellarDb
star, planet = "WASP-107", "b"
datasets = {50: "WASP-107b_SNR50", 100: "WASP-107b_SNR100", 200: "WASP-107b_SNR200"}
sdb... | true | true |
1c43e6f20ef928918c97de09f2b91fbfbcc389dc | 669 | py | Python | app/core/management/commands/wait_for_db.py | amirhosseyn/Django-REST | e8c031c8e5d00ae5a9a8732b7c298bb9c2afa8f9 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | amirhosseyn/Django-REST | e8c031c8e5d00ae5a9a8732b7c298bb9c2afa8f9 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | amirhosseyn/Django-REST | e8c031c8e5d00ae5a9a8732b7c298bb9c2afa8f9 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until db is up 'n running"""
def handle(self, *args, **options):
self.stdout.write('Waiting ... | 30.409091 | 77 | 0.647235 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Waiting for database...')
db_conn = None
while not db_conn:
... | true | true |
1c43e74182739e0186666a6172b8f37cc901b2d5 | 11,035 | py | Python | mistral/services/scheduler.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 3 | 2015-08-28T04:57:56.000Z | 2017-03-27T10:59:56.000Z | mistral/services/scheduler.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 21 | 2015-04-14T22:41:53.000Z | 2019-02-20T09:30:10.000Z | mistral/services/scheduler.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 12 | 2015-08-14T02:27:37.000Z | 2020-12-31T10:09:21.000Z | # Copyright 2014 - Mirantis, Inc.
# Copyright 2015 - StackStorm, Inc.
# Copyright 2016 - Brocade Communications 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
#
# ... | 32.360704 | 79 | 0.610603 |
import copy
import datetime
import eventlet
import random
import sys
import threading
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from mistral import context
from mistral.db import utils as db_utils
from mistral.db.v2 import api as db_api
from mis... | true | true |
1c43e8343e5b9fcf66ef7bb70fa6262538d43d26 | 1,366 | py | Python | src/room.py | ThaDeveloper/docopt_dojo | adc09fda16a84f81776a284249615aa69ebc6861 | [
"MIT"
] | null | null | null | src/room.py | ThaDeveloper/docopt_dojo | adc09fda16a84f81776a284249615aa69ebc6861 | [
"MIT"
] | 14 | 2017-11-04T09:26:08.000Z | 2017-11-13T19:24:30.000Z | src/room.py | ThaDeveloper/docopt_dojo | adc09fda16a84f81776a284249615aa69ebc6861 | [
"MIT"
] | null | null | null | class Room(object):
'''
The Room class models the rooms in Dojo and
is used as the blueprint for how the LivingSpace
and OfficeSpace classes inehrit properties such
as room_name,room_type and capacity.s
'''
def __init__(self, room_name, room_type, capacity):
self.room_type = room_ty... | 31.767442 | 79 | 0.664714 | class Room(object):
def __init__(self, room_name, room_type, capacity):
self.room_type = room_type.strip().title()
self.capacity = capacity
self.room_name = room_name.title()
self.occupants = []
def add_person(self, person):
self.occupants.append(person)
self.ca... | true | true |
1c43e8deb31d64389ccc2664be037b8b793fb6b7 | 1,425 | py | Python | app/settings/migrations/0007_default_statuses.py | mandarhan/mandarhan | 9ce38d10e536e0d3e2f907c3b5c560d66ccf8e40 | [
"MIT"
] | null | null | null | app/settings/migrations/0007_default_statuses.py | mandarhan/mandarhan | 9ce38d10e536e0d3e2f907c3b5c560d66ccf8e40 | [
"MIT"
] | 6 | 2020-02-18T03:49:09.000Z | 2022-03-12T00:10:05.000Z | app/settings/migrations/0007_default_statuses.py | mandarhan/mandarhan | 9ce38d10e536e0d3e2f907c3b5c560d66ccf8e40 | [
"MIT"
] | 1 | 2020-03-25T10:25:43.000Z | 2020-03-25T10:25:43.000Z | from django.db import migrations
DEFAULT_STATUSES = [
{
'name': 'Не подтверждено',
'color': '#ffffff',
},
{
'name': 'Отменено',
'color': '#ff0000',
},
{
'name': 'Подтверждено',
'color': '#daf9d3',
},
{
'name': 'Выезд',
'color':... | 23.360656 | 79 | 0.592281 | from django.db import migrations
DEFAULT_STATUSES = [
{
'name': 'Не подтверждено',
'color': '#ffffff',
},
{
'name': 'Отменено',
'color': '#ff0000',
},
{
'name': 'Подтверждено',
'color': '#daf9d3',
},
{
'name': 'Выезд',
'color':... | true | true |
1c43e93aec0b6c7b8788a78435e14115b15fa430 | 883 | py | Python | arjuna/tpi/guiauto/source/page.py | StefanIGit/arjuna | 6c7d9099e0d766e7b30936ef25d32c1414133b96 | [
"Apache-2.0"
] | 13 | 2020-05-12T06:32:51.000Z | 2022-01-24T18:21:19.000Z | arjuna/tpi/guiauto/source/page.py | StefanIGit/arjuna | 6c7d9099e0d766e7b30936ef25d32c1414133b96 | [
"Apache-2.0"
] | 5 | 2020-02-14T12:51:07.000Z | 2021-12-01T10:39:51.000Z | arjuna/tpi/guiauto/source/page.py | StefanIGit/arjuna | 6c7d9099e0d766e7b30936ef25d32c1414133b96 | [
"Apache-2.0"
] | 25 | 2020-01-16T10:44:25.000Z | 2022-02-24T13:22:22.000Z | # This file is a part of Arjuna
# Copyright 2015-2021 Rahul Verma
# Website: www.RahulVerma.net
# 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... | 32.703704 | 74 | 0.745187 |
from arjuna.tpi.tracker import track
from .base import SingleGuiEntitySource
class GuiPageSource(SingleGuiEntitySource):
def __init__(self, raw_source):
super().__init__(raw_source) | true | true |
1c43e9d6ffce0cb69156cdc14c9713e3fe44aeb5 | 1,048 | py | Python | Crawler/crawlerpchome.py | 2017HackNTU/J94FintechLa | 85018fae23cff1d64f3c95c1e0f9c312dd47eade | [
"MIT"
] | null | null | null | Crawler/crawlerpchome.py | 2017HackNTU/J94FintechLa | 85018fae23cff1d64f3c95c1e0f9c312dd47eade | [
"MIT"
] | null | null | null | Crawler/crawlerpchome.py | 2017HackNTU/J94FintechLa | 85018fae23cff1d64f3c95c1e0f9c312dd47eade | [
"MIT"
] | null | null | null | import requests
from selenium import webdriver
from lxml import etree
import re
import csv
import sys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# reference: http://tw.pyladies.com/~marsw/crawler02.slides.html#/3
# change to mobile website
# url = sys.argv[1]
# match = re.split(r'\?... | 26.871795 | 87 | 0.678435 | import requests
from selenium import webdriver
from lxml import etree
import re
import csv
import sys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.PhantomJS(executable_path=r'path_to_phantomjs/bin/phantomjs')
driver.get(url)
pageSource = driver.page_source
drive... | true | true |
1c43eae2870d470e535993d01691bd86de721d61 | 714 | py | Python | example/mulit_sleep.py | zhzLuke96/Yoi | 8f5a0b6881c540aab71b8a360002b4d1e9de869a | [
"MIT"
] | null | null | null | example/mulit_sleep.py | zhzLuke96/Yoi | 8f5a0b6881c540aab71b8a360002b4d1e9de869a | [
"MIT"
] | null | null | null | example/mulit_sleep.py | zhzLuke96/Yoi | 8f5a0b6881c540aab71b8a360002b4d1e9de869a | [
"MIT"
] | null | null | null | from yoi.application import Application
import time
app = Application()
@app.router(r"^/sleep/(.+)/?$", methods=["GET"])
def index(request,timer):
time.sleep(int(timer))
return f"server sleep {timer}s"
@app.router(r"^/do/?$", methods=["GET"])
def index():
return f"server do something"
if __name__ == '... | 23.032258 | 59 | 0.635854 | from yoi.application import Application
import time
app = Application()
@app.router(r"^/sleep/(.+)/?$", methods=["GET"])
def index(request,timer):
time.sleep(int(timer))
return f"server sleep {timer}s"
@app.router(r"^/do/?$", methods=["GET"])
def index():
return f"server do something"
if __name__ == '... | true | true |
1c43eb9d91553b0505a12be5e48dae5a530b845e | 55,590 | py | Python | nitro/resource/config/ns/nsip.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | 2 | 2020-08-24T18:04:22.000Z | 2020-08-24T18:04:47.000Z | nitro/resource/config/ns/nsip.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | null | null | null | nitro/resource/config/ns/nsip.py | HanseMerkur/nitro-python | d03eb11f492a35a2a8b2a140322fbce22d25a8f7 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2008-2015 Citrix 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 l... | 39.792412 | 320 | 0.595215 |
from nitro.resource.base.base_resource import base_resource
from nitro.resource.base.base_resource import base_response
from nitro.service.options import options
from nitro.exception.nitro_exception import nitro_exception
from nitro.util.nitro_util import nitro_util
class nsip(base_resource) :
def... | true | true |
1c43ec75bb5086504e75a9f3c53c197ac7943cec | 27,444 | py | Python | pytorch_lightning/metrics/functional/classification.py | rwbfd/pytorch-lightning | f518ee6e25d1499f73cec86ca8b3f584d0fa440d | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/metrics/functional/classification.py | rwbfd/pytorch-lightning | f518ee6e25d1499f73cec86ca8b3f584d0fa440d | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/metrics/functional/classification.py | rwbfd/pytorch-lightning | f518ee6e25d1499f73cec86ca8b3f584d0fa440d | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 35.411613 | 119 | 0.606872 |
from functools import wraps
from typing import Callable, Optional, Sequence, Tuple
import torch
from torch.nn import functional as F
from pytorch_lightning.metrics.utils import to_categorical, get_num_classes, reduce, class_reduce
from pytorch_lightning.utilities import rank_zero_warn
def stat_scores(
... | true | true |
1c43ed7d220ae5c354a0880adcfe135d8c75bc34 | 533 | py | Python | apps/discovery_pyre/setup.py | danieldUKIM/uniflex_wishrem | 44ca1cfaafc33a83e856dbf9eaf9c1b83d0a477b | [
"Apache-2.0"
] | null | null | null | apps/discovery_pyre/setup.py | danieldUKIM/uniflex_wishrem | 44ca1cfaafc33a83e856dbf9eaf9c1b83d0a477b | [
"Apache-2.0"
] | null | null | null | apps/discovery_pyre/setup.py | danieldUKIM/uniflex_wishrem | 44ca1cfaafc33a83e856dbf9eaf9c1b83d0a477b | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
def readme():
with open('README.md') as f:
return f.read()
setup(
name='uniflex_app_discovery_pyre',
version='0.1.0',
packages=find_packages(),
url='https://github.com/uniflex',
license='',
author='Piotr Gawlowicz',
author_email='ga... | 24.227273 | 69 | 0.679174 | from setuptools import setup, find_packages
def readme():
with open('README.md') as f:
return f.read()
setup(
name='uniflex_app_discovery_pyre',
version='0.1.0',
packages=find_packages(),
url='https://github.com/uniflex',
license='',
author='Piotr Gawlowicz',
author_email='ga... | true | true |
1c43edf8164ff697a3643279f919165a53782629 | 3,027 | py | Python | analysis/ShowerLLH/reco-vs-true-containment.py | jrbourbeau/composition | f8debd81b0467a6094d5ba56a5f0fc6047369d30 | [
"MIT"
] | null | null | null | analysis/ShowerLLH/reco-vs-true-containment.py | jrbourbeau/composition | f8debd81b0467a6094d5ba56a5f0fc6047369d30 | [
"MIT"
] | 7 | 2017-08-29T16:20:04.000Z | 2018-06-12T16:58:36.000Z | analysis/ShowerLLH/reco-vs-true-containment.py | jrbourbeau/composition | f8debd81b0467a6094d5ba56a5f0fc6047369d30 | [
"MIT"
] | 1 | 2018-04-03T20:56:40.000Z | 2018-04-03T20:56:40.000Z | #!/usr/bin/env python
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import argparse
import seaborn.apionly as sns
import composition.support_functions.paths as paths
from composition.support_functions.checkdir import checkdir
from composition.analysis.lo... | 36.914634 | 87 | 0.620747 |
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import argparse
import seaborn.apionly as sns
import composition.support_functions.paths as paths
from composition.support_functions.checkdir import checkdir
from composition.analysis.load_sim import load_si... | true | true |
1c43ef84bcf1442ec9423ec76142e69ad5abe1c0 | 8,496 | py | Python | moto/awslambda/responses.py | kitagawa-hr/moto | 97408552a323af27d9b755e5456888c496a3739d | [
"Apache-2.0"
] | 1 | 2019-07-09T17:53:48.000Z | 2019-07-09T17:53:48.000Z | moto/awslambda/responses.py | kitagawa-hr/moto | 97408552a323af27d9b755e5456888c496a3739d | [
"Apache-2.0"
] | null | null | null | moto/awslambda/responses.py | kitagawa-hr/moto | 97408552a323af27d9b755e5456888c496a3739d | [
"Apache-2.0"
] | 1 | 2019-03-22T16:06:53.000Z | 2019-03-22T16:06:53.000Z | from __future__ import unicode_literals
import json
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote
from moto.core.utils import amz_crc32, amzn_request_id, path_url
from moto.core.responses import BaseResponse
from .models import lambda_backends
class LambdaResponse(Bas... | 34.819672 | 103 | 0.608639 | from __future__ import unicode_literals
import json
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote
from moto.core.utils import amz_crc32, amzn_request_id, path_url
from moto.core.responses import BaseResponse
from .models import lambda_backends
class LambdaResponse(Bas... | true | true |
1c43efd4690d44c896278c222e4064eae7a1c463 | 766 | py | Python | chalicelib/filter.py | uchimanajet7/reacjilator-chalice | 338daf544432f669f9bd6e78cf91d4363d6b914f | [
"MIT"
] | null | null | null | chalicelib/filter.py | uchimanajet7/reacjilator-chalice | 338daf544432f669f9bd6e78cf91d4363d6b914f | [
"MIT"
] | 1 | 2017-12-17T09:35:24.000Z | 2017-12-18T01:26:54.000Z | chalicelib/filter.py | uchimanajet7/reacjilator-chalice | 338daf544432f669f9bd6e78cf91d4363d6b914f | [
"MIT"
] | null | null | null | # List of channels you want to translate.
import os
import json
class Filter:
def __init__(self):
self.dict_filter = self.__open_json_file__('filter.json')
def __open_json_file__(self, file_name):
try:
dir_name = os.path.dirname(os.path.abspath(__file__))
path = os.pat... | 23.9375 | 65 | 0.571802 |
import os
import json
class Filter:
def __init__(self):
self.dict_filter = self.__open_json_file__('filter.json')
def __open_json_file__(self, file_name):
try:
dir_name = os.path.dirname(os.path.abspath(__file__))
path = os.path.join(dir_name, file_name)
w... | true | true |
1c43f070abcedc58bf17a00a3203fb43ef6b40c7 | 20 | py | Python | sdk/python-sdk/verity_sdk/protocols/v0_7/__init__.py | tw-bc-group/verity-sdk | e932209ab849f04a389bdda0718cd6227187e5cf | [
"Apache-2.0"
] | 40 | 2020-07-09T01:52:31.000Z | 2022-02-19T04:01:23.000Z | sdk/python-sdk/verity_sdk/protocols/v0_7/__init__.py | tw-bc-group/verity-sdk | e932209ab849f04a389bdda0718cd6227187e5cf | [
"Apache-2.0"
] | 45 | 2020-06-19T11:00:20.000Z | 2022-03-02T14:48:12.000Z | sdk/python-sdk/verity_sdk/protocols/v0_7/__init__.py | tw-bc-group/verity-sdk | e932209ab849f04a389bdda0718cd6227187e5cf | [
"Apache-2.0"
] | 37 | 2020-06-19T10:37:04.000Z | 2022-03-15T14:06:40.000Z | """0.7 Protocols"""
| 10 | 19 | 0.55 | true | true | |
1c43f09b4f119c9983b09c54d4a22142b88b1195 | 3,909 | py | Python | pong/2_pong_singlecubebouncing.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | pong/2_pong_singlecubebouncing.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | pong/2_pong_singlecubebouncing.py | CrtomirJuren/pygame-projects | f710f36050bfe3ece866bbda7d570caa1e037d7a | [
"MIT"
] | null | null | null | import sys
import math
import random
import pygame
from pygame.locals import *
import tkinter as tk
from tkinter import messagebox
clock = pygame.time.Clock()
WHITE = (255,255,255)
BLACK = (0,0,0)
RED = (255,0,0)
#--------------------------draw grid fuction----------------------------
def drawGrid(w,rows,surface):
"... | 27.723404 | 88 | 0.553083 | import sys
import math
import random
import pygame
from pygame.locals import *
import tkinter as tk
from tkinter import messagebox
clock = pygame.time.Clock()
WHITE = (255,255,255)
BLACK = (0,0,0)
RED = (255,0,0)
def drawGrid(w,rows,surface):
sizeBtwn = w // rows
x = 0
y = 0
for l in range(rows):
x = x + ... | true | true |
1c43f0cb68057fe546f78196c9cc49dd1da135d3 | 6,696 | py | Python | source/minefield.py | BastiHz/Minefields | 46bb66cb3a809f6d21d7811e9a7df214be044fbd | [
"MIT"
] | 1 | 2021-02-22T15:32:31.000Z | 2021-02-22T15:32:31.000Z | source/minefield.py | BastiHz/Minefields | 46bb66cb3a809f6d21d7811e9a7df214be044fbd | [
"MIT"
] | null | null | null | source/minefield.py | BastiHz/Minefields | 46bb66cb3a809f6d21d7811e9a7df214be044fbd | [
"MIT"
] | null | null | null | import random
import pygame as pg
import prepare
class Minefield:
def __init__(self, width, height, number_of_mines):
self.width = width
self.height = height
self.num_mines = number_of_mines
self.tiles = prepare.minefield_tiles
self.tile_size = prepare.MINEFIELD_TILE_SIZ... | 39.621302 | 80 | 0.538082 | import random
import pygame as pg
import prepare
class Minefield:
def __init__(self, width, height, number_of_mines):
self.width = width
self.height = height
self.num_mines = number_of_mines
self.tiles = prepare.minefield_tiles
self.tile_size = prepare.MINEFIELD_TILE_SIZ... | true | true |
1c43f0d5386fd740efb998b838ef3980fb5d15bf | 7,728 | py | Python | torchreid/models/squeezenet.py | qw85639229/hardest | ef86536dbbe1089248e34afbbb7bb513f97f58f1 | [
"MIT"
] | 21 | 2020-10-13T01:33:31.000Z | 2022-01-04T15:58:31.000Z | torchreid/models/squeezenet.py | qw85639229/hardest | ef86536dbbe1089248e34afbbb7bb513f97f58f1 | [
"MIT"
] | 10 | 2020-11-18T07:40:22.000Z | 2021-10-05T07:58:25.000Z | torchreid/models/squeezenet.py | qw85639229/hardest | ef86536dbbe1089248e34afbbb7bb513f97f58f1 | [
"MIT"
] | 7 | 2020-11-19T08:40:27.000Z | 2022-02-05T06:24:08.000Z | """
Code source: https://github.com/pytorch/vision
"""
from __future__ import absolute_import
from __future__ import division
__all__ = [
'squeezenet1_0',
'squeezenet1_1',
'squeezenet1_0_fc512'
]
from collections import OrderedDict
import math
import torch
import torch.nn as nn
from torch.utils import mo... | 33.454545 | 123 | 0.583075 | from __future__ import absolute_import
from __future__ import division
__all__ = [
'squeezenet1_0',
'squeezenet1_1',
'squeezenet1_0_fc512'
]
from collections import OrderedDict
import math
import torch
import torch.nn as nn
from torch.utils import model_zoo
from torch.nn import functional as F
import tor... | true | true |
1c43f0f37d381ccc50b76c9a1eb0cc96c6d62613 | 10,065 | py | Python | DPDNet/image_to_patch_filter.py | Abdullah-Abuolaim/defocus-deblurring-dual-pixel | 21a43e7d12350c62c4038485cdeebc27a078765b | [
"MIT"
] | 115 | 2020-05-01T22:51:14.000Z | 2022-03-12T13:18:37.000Z | DPDNet/image_to_patch_filter.py | panpanfei/defocus-deblurring-dual-pixel | 8c1b812236d2eb3293b670512ef35e20471e2e48 | [
"MIT"
] | 14 | 2020-05-12T03:38:57.000Z | 2021-06-01T15:02:04.000Z | DPDNet/image_to_patch_filter.py | Abdullah-Abuolaim/defocus-deblurring-dual-pixel | 21a43e7d12350c62c4038485cdeebc27a078765b | [
"MIT"
] | 13 | 2020-06-28T08:25:09.000Z | 2022-02-28T16:10:46.000Z | """
This code is used to extract image patches from the training and validation
sets as described in the paper. For the training set patches, we discard 30%
of the patches that have the lowest sharpness energy. Recall that we don't
extract patches for test images because we process full image at test time.
Copyright (... | 56.544944 | 187 | 0.719424 |
import numpy as np
import os
import cv2
import errno
from copy import deepcopy
def check_create_directory(path_to_check):
if not os.path.exists(path_to_check):
try:
os.makedirs(path_to_check)
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
def s... | true | true |
1c43f2f1279c5e8aee0def23c69b53b4bb131a33 | 556 | py | Python | examples/server/asgi/simple.py | 13g10n/python-engineio | e882f5949bdd1618d97b0cade18a7e8af8670b41 | [
"MIT"
] | 208 | 2015-06-22T00:44:53.000Z | 2022-02-13T16:39:14.000Z | examples/server/asgi/simple.py | 13g10n/python-engineio | e882f5949bdd1618d97b0cade18a7e8af8670b41 | [
"MIT"
] | 241 | 2015-08-12T06:15:40.000Z | 2022-03-18T19:17:46.000Z | examples/server/asgi/simple.py | 13g10n/python-engineio | e882f5949bdd1618d97b0cade18a7e8af8670b41 | [
"MIT"
] | 153 | 2015-08-08T15:40:45.000Z | 2022-03-29T14:26:32.000Z | import os
import uvicorn
import engineio
eio = engineio.AsyncServer(async_mode='asgi')
app = engineio.ASGIApp(eio, static_files={
'/': 'simple.html',
'/static': 'static',
})
@eio.on('connect')
def connect(sid, environ):
print("connect ", sid)
@eio.on('message')
async def message(sid, data):
print(... | 17.935484 | 54 | 0.656475 | import os
import uvicorn
import engineio
eio = engineio.AsyncServer(async_mode='asgi')
app = engineio.ASGIApp(eio, static_files={
'/': 'simple.html',
'/static': 'static',
})
@eio.on('connect')
def connect(sid, environ):
print("connect ", sid)
@eio.on('message')
async def message(sid, data):
print(... | true | true |
1c43f3b270474db102bfa0c81625d0a5e1cecaa3 | 2,053 | py | Python | budgetportal/tests/test_guides_pages.py | TomaszKolek/datamanager | d46dbab00e30a14fc26eb9368c32dcdbbda7309d | [
"MIT"
] | null | null | null | budgetportal/tests/test_guides_pages.py | TomaszKolek/datamanager | d46dbab00e30a14fc26eb9368c32dcdbbda7309d | [
"MIT"
] | null | null | null | budgetportal/tests/test_guides_pages.py | TomaszKolek/datamanager | d46dbab00e30a14fc26eb9368c32dcdbbda7309d | [
"MIT"
] | null | null | null | from django.core.files.images import ImageFile
from django.test import Client, TestCase
from budgetportal.models import GuideIndexPage, GuidePage, CategoryGuide
class GuideIndexPageTestCase(TestCase):
fixtures = ["test-guides-pages"]
def setUp(self):
self.guide_index_page = GuideIndexPage.objects.get... | 40.254902 | 97 | 0.702874 | from django.core.files.images import ImageFile
from django.test import Client, TestCase
from budgetportal.models import GuideIndexPage, GuidePage, CategoryGuide
class GuideIndexPageTestCase(TestCase):
fixtures = ["test-guides-pages"]
def setUp(self):
self.guide_index_page = GuideIndexPage.objects.get... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.