hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d746a8596ba10873321e6f0daf167ee0a488ce3f | 1,690 | py | Python | steampi/api.py | woctezuma/steampi | c97f0e8ff1a12b8d24f7f375f9ea65b85e57895b | [
"MIT"
] | 5 | 2019-03-11T12:39:37.000Z | 2021-12-21T20:18:43.000Z | steampi/api.py | woctezuma/steampi | c97f0e8ff1a12b8d24f7f375f9ea65b85e57895b | [
"MIT"
] | 10 | 2018-05-21T19:26:38.000Z | 2020-06-19T00:05:14.000Z | steampi/api.py | woctezuma/steampi | c97f0e8ff1a12b8d24f7f375f9ea65b85e57895b | [
"MIT"
] | null | null | null | import pathlib
import steampi.json_utils
def get_appdetails_url(app_id):
url = 'https://store.steampowered.com/api/appdetails?appids=' + str(app_id)
return url
def download_app_details(app_id):
url = get_appdetails_url(app_id)
(data, status_code) = steampi.json_utils.download_json_data(url)
suc... | 28.644068 | 99 | 0.706509 |
939b5555bd5868e74eef145951ba1ea253bda19f | 2,157 | py | Python | examples/node_classification.py | general502570/AutoGL | cbac7954db8555af576692384b09d305a4ef67c2 | [
"MIT"
] | 1 | 2020-12-24T05:56:15.000Z | 2020-12-24T05:56:15.000Z | examples/node_classification.py | lucylow/AutoGL | e560ca7ef3b35a8b85d9b89063ce5ce7afaed52f | [
"MIT"
] | null | null | null | examples/node_classification.py | lucylow/AutoGL | e560ca7ef3b35a8b85d9b89063ce5ce7afaed52f | [
"MIT"
] | null | null | null | import sys
sys.path.append('../')
from autogl.datasets import build_dataset_from_name
from autogl.solver import AutoNodeClassifier
from autogl.module import Acc
import yaml
import random
import torch
import numpy as np
import logging
logging.basicConfig(level=logging.INFO)
if __name__ == '__main__':
from argpars... | 36.559322 | 174 | 0.718591 |
509f8aa5ecd05f97ee4e83b78e517b3690e57c0c | 7,730 | py | Python | pypureclient/flasharray/FA_2_9/models/alert.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_9/models/alert.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_9/models/alert.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.9
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 35.136364 | 130 | 0.557568 |
73e38a8b2f449b777f9352d34d15a1a0a154183e | 895 | py | Python | viewer.py | schwert398/cerke_code | 117591b7d01ce9baa95da35c2931b0fe9fc70462 | [
"MIT"
] | 4 | 2019-06-28T10:48:47.000Z | 2019-10-24T14:56:30.000Z | viewer.py | schwert398/cerke_code | 117591b7d01ce9baa95da35c2931b0fe9fc70462 | [
"MIT"
] | 4 | 2019-07-11T04:49:38.000Z | 2019-10-19T15:37:44.000Z | viewer.py | schwert398/cerke_code | 117591b7d01ce9baa95da35c2931b0fe9fc70462 | [
"MIT"
] | null | null | null | import sys
import pygame
from pygame.locals import *
from module.constant import *
from module.variable import *
from module.material import redo, undo
from module.window import InputBox
from module.hand import *
def text_render(text):
return FontSet.FONT_FILE.render(text, True, (0, 0, 0))
def... | 28.870968 | 66 | 0.680447 |
9715b1ba1c2a85109aec4542544634d201a81458 | 1,118 | py | Python | examples/egoless.py | Semanti1/smarts_baseline | 77dbc350f37ae7735c74a2b8f1585c2818ac3421 | [
"MIT"
] | 1 | 2021-01-09T07:04:28.000Z | 2021-01-09T07:04:28.000Z | examples/egoless.py | Semanti1/smarts_baseline | 77dbc350f37ae7735c74a2b8f1585c2818ac3421 | [
"MIT"
] | null | null | null | examples/egoless.py | Semanti1/smarts_baseline | 77dbc350f37ae7735c74a2b8f1585c2818ac3421 | [
"MIT"
] | null | null | null | import logging
import gym
from smarts.core.utils.episodes import episodes
from examples import default_argument_parser
logging.basicConfig(level=logging.INFO)
def main(scenarios, sim_name, headless, num_episodes, seed, max_episode_steps=None):
env = gym.make(
"smarts.env:hiway-v0",
scenarios=s... | 22.36 | 84 | 0.636852 |
90a4f18125fe3c753a49842f28f127f0c165f281 | 37,223 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_connection_monitors_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_connection_monitors_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations_async/_connection_monitors_operations_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 ... | 50.09825 | 242 | 0.677807 |
46d67e3c9823b1445ee472aa62ba93dcadf621a7 | 31,579 | py | Python | tools/wptrunner/wptrunner/testrunner.py | SearsRoebuckandCo/wpt | 9cc430434a31d0ac5843e64d1724fe52723a0581 | [
"BSD-3-Clause"
] | null | null | null | tools/wptrunner/wptrunner/testrunner.py | SearsRoebuckandCo/wpt | 9cc430434a31d0ac5843e64d1724fe52723a0581 | [
"BSD-3-Clause"
] | 1 | 2021-12-13T19:49:45.000Z | 2021-12-13T19:49:45.000Z | tools/wptrunner/wptrunner/testrunner.py | SearsRoebuckandCo/wpt | 9cc430434a31d0ac5843e64d1724fe52723a0581 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import multiprocessing
import threading
import traceback
from Queue import Empty
from collections import namedtuple
from multiprocessing import Process, current_process, Queue
from mozlog import structuredlog
# Special value used as a sentinal in various commands
Stop = object... | 38.842558 | 116 | 0.589474 |
434beddb00039c7891f52224cf3b24c7cc98e802 | 296 | py | Python | tests/testNewProject.py | guchengxi1994/dev-tool-for-python | dba0bd0daae535ef155c1419d19177d29303b507 | [
"MIT"
] | null | null | null | tests/testNewProject.py | guchengxi1994/dev-tool-for-python | dba0bd0daae535ef155c1419d19177d29303b507 | [
"MIT"
] | null | null | null | tests/testNewProject.py | guchengxi1994/dev-tool-for-python | dba0bd0daae535ef155c1419d19177d29303b507 | [
"MIT"
] | null | null | null | '''
lanhuage: python
Descripttion:
version: beta
Author: xiaoshuyui
Date: 2021-01-15 13:41:18
LastEditors: xiaoshuyui
LastEditTime: 2021-01-15 14:05:50
'''
import sys
sys.path.append("..")
from devtool.devTool import DevTool
if __name__ == "__main__":
DevTool.initProject('Test',tree=True) | 18.5 | 41 | 0.739865 |
b0d9e08e46c1e9a109262421103c2b763f0d6fbb | 1,842 | py | Python | gyun/cli/iaas_client/actions/router/describe_router_vxnets.py | gyun-gome/gyun-cli | 275b6664335e2ef21a01a48f8c06d6a89dd63467 | [
"Apache-2.0"
] | null | null | null | gyun/cli/iaas_client/actions/router/describe_router_vxnets.py | gyun-gome/gyun-cli | 275b6664335e2ef21a01a48f8c06d6a89dd63467 | [
"Apache-2.0"
] | null | null | null | gyun/cli/iaas_client/actions/router/describe_router_vxnets.py | gyun-gome/gyun-cli | 275b6664335e2ef21a01a48f8c06d6a89dd63467 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# =========================================================================
# ©2017-2018 北京国美云服科技有限公司
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the ... | 38.375 | 75 | 0.560261 |
9a6298e13d0a19c088e468e53e8c3fca905c5a2c | 1,658 | py | Python | app/openlxp_xia/management/utils/xis_client.py | OpenLXP/openlxp-xia | 5c71b8d5028562d596ab738b72562118efcbefba | [
"Apache-2.0"
] | null | null | null | app/openlxp_xia/management/utils/xis_client.py | OpenLXP/openlxp-xia | 5c71b8d5028562d596ab738b72562118efcbefba | [
"Apache-2.0"
] | 3 | 2020-12-15T18:33:56.000Z | 2022-03-09T19:43:41.000Z | app/openlxp_xia/management/utils/xis_client.py | OpenLXP/openlxp-xia | 5c71b8d5028562d596ab738b72562118efcbefba | [
"Apache-2.0"
] | null | null | null | import logging
import requests
from openlxp_xia.models import XISConfiguration
logger = logging.getLogger('dict_config_logger')
def get_xis_metadata_api_endpoint():
"""Retrieve xis metadata api endpoint from XIS configuration """
logger.debug("Retrieve XIS metadata ledger api endpoint from "
... | 34.541667 | 76 | 0.737033 |
b589d7ede6e7064a5a769d17690dd29a0f081432 | 21,756 | py | Python | sdk/python/pulumi_ucloud/vpc/nat_gateway_rule.py | AaronFriel/pulumi-ucloud | 199278786dddf46bdd370f3f805e30b279c63ff2 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-08-18T04:55:38.000Z | 2021-09-08T07:59:24.000Z | sdk/python/pulumi_ucloud/vpc/nat_gateway_rule.py | AaronFriel/pulumi-ucloud | 199278786dddf46bdd370f3f805e30b279c63ff2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-01-28T17:59:37.000Z | 2022-01-29T03:44:09.000Z | sdk/python/pulumi_ucloud/vpc/nat_gateway_rule.py | AaronFriel/pulumi-ucloud | 199278786dddf46bdd370f3f805e30b279c63ff2 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-06-23T07:10:40.000Z | 2021-06-23T09:25:12.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | 40.971751 | 140 | 0.617255 |
691a419b6f9e06be437ce58234357453a0f35150 | 9,470 | py | Python | refactorings/replace_parameter_with_query.py | Amin-MAG/CodART | a964a506d031f6eea505df081b9ba946f490d021 | [
"MIT"
] | 18 | 2020-11-26T08:31:27.000Z | 2022-03-28T07:35:41.000Z | refactorings/replace_parameter_with_query.py | Amin-MAG/CodART | a964a506d031f6eea505df081b9ba946f490d021 | [
"MIT"
] | 82 | 2020-12-25T08:26:27.000Z | 2022-03-25T06:11:36.000Z | refactorings/replace_parameter_with_query.py | Amin-MAG/CodART | a964a506d031f6eea505df081b9ba946f490d021 | [
"MIT"
] | 59 | 2020-11-26T08:31:42.000Z | 2022-02-04T11:09:03.000Z | from antlr4 import *
from antlr4.TokenStreamRewriter import TokenStreamRewriter
from gen.java.JavaLexer import JavaLexer
from gen.javaLabeled.JavaParserLabeled import JavaParserLabeled
from gen.javaLabeled.JavaParserLabeledListener import JavaParserLabeledListener
class ReplaceParameterWithQueryRefactoringListener(J... | 41.902655 | 106 | 0.631151 |
4a04a539bdcec91ad7da1e82bde99b0076154653 | 2,844 | py | Python | bot.py | Akashakashav/video-merge-bot | 0e17b4e07067014fe216829c6223b13c32f3e87a | [
"MIT"
] | null | null | null | bot.py | Akashakashav/video-merge-bot | 0e17b4e07067014fe216829c6223b13c32f3e87a | [
"MIT"
] | null | null | null | bot.py | Akashakashav/video-merge-bot | 0e17b4e07067014fe216829c6223b13c32f3e87a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from logging import DEBUG
import subprocess
import os
import requests
import logging
import sys
from autologging import logged, traced
import telebot
from decouple import config
# Enable logging
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(me... | 25.854545 | 79 | 0.636428 |
9f9766852d5fcbe2193aa11a37ab0939ec0650b8 | 182 | py | Python | Section 9/filewrite1.py | PacktPublishing/Learning-Python-v- | 30fb28dfaaa18815f1b4c0b683e8839da223b195 | [
"MIT"
] | 1 | 2021-10-05T19:45:43.000Z | 2021-10-05T19:45:43.000Z | Section 9/filewrite1.py | PacktPublishing/Learning-Python-v- | 30fb28dfaaa18815f1b4c0b683e8839da223b195 | [
"MIT"
] | null | null | null | Section 9/filewrite1.py | PacktPublishing/Learning-Python-v- | 30fb28dfaaa18815f1b4c0b683e8839da223b195 | [
"MIT"
] | 2 | 2020-09-25T19:56:46.000Z | 2021-09-02T11:14:28.000Z | file_input = open("motivation.txt",'w')
file_input.write("Never give up")
file_input.write("\nRise above hate")
file_input.write("\nNo body remember second place")
file_input.close() | 36.4 | 51 | 0.763736 |
42dd1f876bddc6a8c9f2a626f44942b6ed8dc0fe | 20,913 | py | Python | qmpy/materials/entry.py | kdmsit/qmpy | 5355d465e8bcc01058385484f2a77b4851b1fe87 | [
"MIT"
] | 1 | 2018-07-04T03:51:45.000Z | 2018-07-04T03:51:45.000Z | qmpy/materials/entry.py | kdmsit/qmpy | 5355d465e8bcc01058385484f2a77b4851b1fe87 | [
"MIT"
] | null | null | null | qmpy/materials/entry.py | kdmsit/qmpy | 5355d465e8bcc01058385484f2a77b4851b1fe87 | [
"MIT"
] | 2 | 2018-10-30T20:36:59.000Z | 2019-10-08T15:52:07.000Z | # qmpy/materials/entry.py
from datetime import datetime
import time
import os
from django.db import models
from django.db import transaction
import networkx as nx
from qmpy.db.custom import *
from qmpy.materials.composition import *
from qmpy.materials.element import Element, Species
from qmpy.materials.structure im... | 32.7277 | 98 | 0.594893 |
4cc9412543f9a62de1e7d513e14e619713e72108 | 2,871 | py | Python | tests/test_valuelesscoin.py | robertkarl/yabc | 400957bcc500d364dc86b2ef41c5f65da82efbdc | [
"MIT"
] | 14 | 2019-08-13T20:06:50.000Z | 2021-07-05T06:41:36.000Z | tests/test_valuelesscoin.py | robertkarl/yabc | 400957bcc500d364dc86b2ef41c5f65da82efbdc | [
"MIT"
] | 15 | 2019-04-18T22:33:20.000Z | 2020-01-30T01:35:27.000Z | tests/test_valuelesscoin.py | robertkarl/yabc | 400957bcc500d364dc86b2ef41c5f65da82efbdc | [
"MIT"
] | null | null | null | import datetime
import unittest
from yabc import basis
from yabc import coinpool
from yabc import ohlcprovider
from yabc import transaction
from yabc import user # noqa
from yabc.transaction import Transaction
BUY = Transaction.Operation.BUY
SELL = Transaction.Operation.SELL
class TransactionTest(unittest.TestCase... | 32.625 | 95 | 0.59596 |
6b8250090186ce57e99480103860925b250845c0 | 780 | py | Python | models.py | tbradshaw91/TwitterBowl | 5a6f9e5f4c5f1becef2c0c6ab55cb9c21fa4c22b | [
"MIT"
] | null | null | null | models.py | tbradshaw91/TwitterBowl | 5a6f9e5f4c5f1becef2c0c6ab55cb9c21fa4c22b | [
"MIT"
] | null | null | null | models.py | tbradshaw91/TwitterBowl | 5a6f9e5f4c5f1becef2c0c6ab55cb9c21fa4c22b | [
"MIT"
] | 1 | 2019-07-31T02:35:11.000Z | 2019-07-31T02:35:11.000Z | from flask_sqlalchemy import SQLAlchemy
DB = SQLAlchemy()
class User(DB.Model):
""" Twitter users that we pull and analyze Tweets for."""
id = DB.Column(DB.Integer, primary_key=True)
name = DB.Column(DB.String(15), nullable=False)
newest_tweet_id = DB.Column(DB.BigInteger)
def __repr__(self):
... | 28.888889 | 80 | 0.671795 |
00f71bbd890a8f7815955c795c026e7a3a96962b | 90 | py | Python | .history/Methods and Functions/Map_Func_20200509082033.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | 1 | 2020-05-18T17:50:00.000Z | 2020-05-18T17:50:00.000Z | .history/Methods and Functions/Map_Func_20200509082033.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | null | null | null | .history/Methods and Functions/Map_Func_20200509082033.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | null | null | null | def square(num):
print(num**2)
my_nums = [1,2,3,4,5]
for item in map(square, my_nums)
| 18 | 32 | 0.644444 |
fffe1f140606648f3cef1337ea2f350915bfa3d6 | 97 | py | Python | application/contributor/apps.py | sid-7/Pitcher | d2e611c0aa33eb0a171a742d5fe6b2566027eac1 | [
"MIT"
] | null | null | null | application/contributor/apps.py | sid-7/Pitcher | d2e611c0aa33eb0a171a742d5fe6b2566027eac1 | [
"MIT"
] | 8 | 2021-03-30T13:20:26.000Z | 2021-09-22T19:00:35.000Z | application/contributor/apps.py | sid-7/Pitcher | d2e611c0aa33eb0a171a742d5fe6b2566027eac1 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class ContributorConfig(AppConfig):
name = 'contributor'
| 16.166667 | 35 | 0.773196 |
a898fcb0a51b5982d9616188b317cc6307a4fd96 | 32,081 | py | Python | leo/core/leoRst.py | tbpassin/leo-editor | ee0a3334b466f6c6a260a62e8be0e90de0cb7156 | [
"MIT"
] | null | null | null | leo/core/leoRst.py | tbpassin/leo-editor | ee0a3334b466f6c6a260a62e8be0e90de0cb7156 | [
"MIT"
] | null | null | null | leo/core/leoRst.py | tbpassin/leo-editor | ee0a3334b466f6c6a260a62e8be0e90de0cb7156 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20090502071837.3: * @file leoRst.py
#@@first
#@+<< docstring >>
#@+node:ekr.20090502071837.4: ** << docstring >>
"""Support for restructured text (rST), adapted from rst3 plugin.
For full documentation, see: http://leoeditor.com/rstplugin3.html
To generate documen... | 38.698432 | 112 | 0.555594 |
445f416a4fc368c03befbd815dd8992c0e986e19 | 1,530 | py | Python | tutorials/complete2d.py | LemnX4/PointDipole | 79223498f6adce9d4f33939bd0173e9f7cd9132a | [
"MIT"
] | null | null | null | tutorials/complete2d.py | LemnX4/PointDipole | 79223498f6adce9d4f33939bd0173e9f7cd9132a | [
"MIT"
] | null | null | null | tutorials/complete2d.py | LemnX4/PointDipole | 79223498f6adce9d4f33939bd0173e9f7cd9132a | [
"MIT"
] | null | null | null | # vim: set et sw=4 ts=4 nu fdm=indent:
# coding: utf8
import sys
sys.path.insert(1, "../src")
from system import System
from island import Island
import numpy as np
import random
# we create the system
system = System("2D")
R = 5
N = 6
# we create a nanowatch
system.add_object(Island([0, 0], [2*random.random()-... | 15.612245 | 81 | 0.648366 |
f91e09dbca6f9bdc323dfd65279df706ffc822f3 | 1,621 | py | Python | koku/api/resource_types/aws_services/view.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | 2 | 2022-01-12T03:42:39.000Z | 2022-01-12T03:42:40.000Z | koku/api/resource_types/aws_services/view.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | null | null | null | koku/api/resource_types/aws_services/view.py | Vasyka/koku | b5aa9ec41c3b0821e74afe9ff3a5ffaedb910614 | [
"Apache-2.0"
] | 1 | 2021-07-21T09:33:59.000Z | 2021-07-21T09:33:59.000Z | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""View for AWS service units."""
from django.db.models import F
from django.utils.decorators import method_decorator
from django.views.decorators.vary import vary_on_headers
from rest_framework import filters
from rest_framework import generics
f... | 37.697674 | 108 | 0.732881 |
3b4c4373ea0d5a65b436057027fc7a80e6146a52 | 1,129 | py | Python | scrape.py | nadhirxz/athan-parser | 3ebb99d27e592e87e098dfb8582f328a8d0e0bc2 | [
"MIT"
] | 1 | 2022-01-09T23:48:18.000Z | 2022-01-09T23:48:18.000Z | scrape.py | nadhirxz/athan-parser | 3ebb99d27e592e87e098dfb8582f328a8d0e0bc2 | [
"MIT"
] | null | null | null | scrape.py | nadhirxz/athan-parser | 3ebb99d27e592e87e098dfb8582f328a8d0e0bc2 | [
"MIT"
] | null | null | null | import PyPDF4
import fitz
from pathlib import Path
from tqdm import tqdm
import os
import re
INPUT_FOLDER = './input'
print('Scraping data from PDF')
for dir in os.listdir(INPUT_FOLDER):
if (re.match(r'\d{4}', dir)):
p = os.path.join(INPUT_FOLDER, dir)
places = ['alger', 'adrar', 'djelfa']
for place in place... | 30.513514 | 120 | 0.642161 |
545594fa6cddb9a500aff0969c891431ba50c77f | 338 | py | Python | mesh_client/key_helper.py | sivang/mesh-client | 16518f6cce13fe0fd37107ded9df16a87a00d82a | [
"MIT"
] | 6 | 2020-04-09T09:28:02.000Z | 2022-01-10T20:18:42.000Z | mesh_client/key_helper.py | sivang/mesh-client | 16518f6cce13fe0fd37107ded9df16a87a00d82a | [
"MIT"
] | 4 | 2021-08-18T13:06:44.000Z | 2022-02-22T12:20:26.000Z | mesh_client/key_helper.py | sivang/mesh-client | 16518f6cce13fe0fd37107ded9df16a87a00d82a | [
"MIT"
] | 3 | 2020-05-03T07:01:55.000Z | 2022-02-22T11:20:54.000Z | import os
def get_shared_key_from_environ():
key = os.environ.get(
'MESH_CLIENT_SHARED_KEY',
'\x42\x61\x63\x6b\x42\x6f\x6e\x65'
)
if not isinstance(key, bytes):
# Handle Python 3's non-Posix handling of binary environment variables
key = key.encode('utf-8', 'surrogateescape... | 26 | 78 | 0.650888 |
630291ca6c68c1579471775be91956efd6e19a84 | 4,643 | py | Python | pyecharts/datasets/__init__.py | CharileWithZoe/pyecharts | dbded9a8932cc13840b7d130802176fd88a97bf8 | [
"MIT"
] | 11,032 | 2017-12-21T01:21:38.000Z | 2022-03-31T23:02:38.000Z | pyecharts/datasets/__init__.py | reed-hong/pyecharts | 5f01f2fb43d1602a46d77234721450008cbff7eb | [
"MIT"
] | 1,687 | 2017-12-21T02:10:47.000Z | 2022-03-31T14:31:45.000Z | pyecharts/datasets/__init__.py | reed-hong/pyecharts | 5f01f2fb43d1602a46d77234721450008cbff7eb | [
"MIT"
] | 2,528 | 2017-12-21T07:57:52.000Z | 2022-03-30T15:34:51.000Z | import difflib
import os
import typing
import urllib.request
import simplejson as json
class FuzzyDict(dict):
"""Provides a dictionary that performs fuzzy lookup"""
def __init__(self, cutoff: float = 0.6):
"""Construct a new FuzzyDict instance
items is an dictionary to copy it... | 32.697183 | 85 | 0.574413 |
893e718d6b7b6c3872a92282121fa25be5df973b | 6,922 | py | Python | lightly/api/bitmask.py | CodeGuy-007/lightly | 64143fe8a477c04288009c65fa1265cef8aa48f8 | [
"MIT"
] | 1,515 | 2020-10-05T13:04:17.000Z | 2022-03-31T16:14:55.000Z | lightly/api/bitmask.py | CodeGuy-007/lightly | 64143fe8a477c04288009c65fa1265cef8aa48f8 | [
"MIT"
] | 628 | 2020-10-14T11:38:51.000Z | 2022-03-31T14:40:54.000Z | lightly/api/bitmask.py | CodeGuy-007/lightly | 64143fe8a477c04288009c65fa1265cef8aa48f8 | [
"MIT"
] | 108 | 2020-10-17T08:31:06.000Z | 2022-03-20T16:44:22.000Z | """ Module to work with Lightly BitMasks """
# Copyright (c) 2020. Lightly AG and its affiliates.
# All Rights Reserved
from copy import deepcopy
from typing import List
def _hex_to_int(hexstring: str) -> int:
"""Converts a hex string representation of an integer to an integer.
"""
return int(hexstring, ... | 28.841667 | 83 | 0.565732 |
fe56b41c2918d3bd4fe5eec0a28dd4527ff326f4 | 1,652 | py | Python | setup.py | mats16/aws-xray-sdk-python | 00d01a9eef1eb5ea11e091484f5da545eeacb2d3 | [
"Apache-2.0"
] | null | null | null | setup.py | mats16/aws-xray-sdk-python | 00d01a9eef1eb5ea11e091484f5da545eeacb2d3 | [
"Apache-2.0"
] | null | null | null | setup.py | mats16/aws-xray-sdk-python | 00d01a9eef1eb5ea11e091484f5da545eeacb2d3 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
from os import path
from aws_xray_sdk.version import VERSION
CURRENT_DIR = path.abspath(path.dirname(__file__))
try:
from pypandoc import convert
read_md = lambda f: convert(f, 'rst')
except ImportError:
read_md = lambda f: open(f, 'r').read()
long_description ... | 28.982456 | 97 | 0.641041 |
923ac14f6e73b0465b03d79f498e3444ded673e9 | 2,190 | py | Python | crypto/rsa/rsa_method.py | RoderickChan/ctf_all_in_one | e0c1285e5fe9ba5de5e1b4ad3ffe20df330aecc8 | [
"MIT"
] | 2 | 2021-08-04T11:13:15.000Z | 2021-09-03T02:45:26.000Z | crypto/rsa/rsa_method.py | RoderickChan/my_own_ctf_box | e0c1285e5fe9ba5de5e1b4ad3ffe20df330aecc8 | [
"MIT"
] | null | null | null | crypto/rsa/rsa_method.py | RoderickChan/my_own_ctf_box | e0c1285e5fe9ba5de5e1b4ad3ffe20df330aecc8 | [
"MIT"
] | null | null | null | # coding:utf-8
import gmpy2
from typing import Tuple
import sympy
import random
from functools import reduce
from Crypto.Util.number import long_to_bytes, bytes_to_long
def get_pq_from_n_ed(n, ed):
'''
根据n e d求解p 和 q
:param n: 模数
:param ed: ed的积
:return: p, q
'''
p = 1
... | 25.764706 | 102 | 0.50274 |
bfa95695a4a49e2b438a823ff866e83cde2e71aa | 12,020 | py | Python | scripts/qapi/visit.py | pan93412/UTM | 4e6a7b4fa9dd9a3e0c740a92e1b4ed7e5144c8ca | [
"Apache-2.0"
] | 2 | 2022-03-13T12:11:28.000Z | 2022-03-13T12:16:18.000Z | scripts/qapi/visit.py | pan93412/UTM | 4e6a7b4fa9dd9a3e0c740a92e1b4ed7e5144c8ca | [
"Apache-2.0"
] | null | null | null | scripts/qapi/visit.py | pan93412/UTM | 4e6a7b4fa9dd9a3e0c740a92e1b4ed7e5144c8ca | [
"Apache-2.0"
] | 1 | 2021-12-22T18:12:06.000Z | 2021-12-22T18:12:06.000Z | """
QAPI visitor generator
Copyright IBM, Corp. 2011
Copyright (C) 2014-2018 Red Hat, Inc.
Authors:
Anthony Liguori <aliguori@us.ibm.com>
Michael Roth <mdroth@linux.vnet.ibm.com>
Markus Armbruster <armbru@redhat.com>
This work is licensed under the terms of the GNU GPL, version 2.
See the COPYING file in the t... | 29.245742 | 79 | 0.538686 |
6a25901d74461d447284590ef99b4e04cfa2ed68 | 1,384 | bzl | Python | tools/type_whisperer/file_descriptor_set_text.bzl | markmandel/envoy | eef74ef97a038280c341a8641a66282200508f15 | [
"Apache-2.0"
] | null | null | null | tools/type_whisperer/file_descriptor_set_text.bzl | markmandel/envoy | eef74ef97a038280c341a8641a66282200508f15 | [
"Apache-2.0"
] | 4 | 2021-06-02T16:01:15.000Z | 2021-11-25T21:03:24.000Z | tools/type_whisperer/file_descriptor_set_text.bzl | markmandel/envoy | eef74ef97a038280c341a8641a66282200508f15 | [
"Apache-2.0"
] | null | null | null | def _file_descriptor_set_text(ctx):
file_descriptor_sets = depset()
for dep in ctx.attr.deps:
file_descriptor_sets = depset(transitive = [
file_descriptor_sets,
dep[ProtoInfo].transitive_descriptor_sets,
])
args = [ctx.outputs.pb_text.path]
for dep in file_descri... | 31.454545 | 83 | 0.612717 |
59f51252aa52c5cf81b1841f0ccb2ad94856ef5c | 4,446 | py | Python | orientation/visuals.py | xiki-tempula/protein_orientation | 60fc67a64edc6b379f09cd74bf96f1d3108297ce | [
"MIT"
] | 1 | 2020-10-05T13:27:09.000Z | 2020-10-05T13:27:09.000Z | orientation/visuals.py | xiki-tempula/protein_orientation | 60fc67a64edc6b379f09cd74bf96f1d3108297ce | [
"MIT"
] | 3 | 2020-11-02T18:29:29.000Z | 2021-09-24T14:42:44.000Z | orientation/visuals.py | xiki-tempula/protein_orientation | 60fc67a64edc6b379f09cd74bf96f1d3108297ce | [
"MIT"
] | 2 | 2020-05-07T09:25:57.000Z | 2020-05-07T09:27:34.000Z | scale_factor = 20
def vis_axes(vis, axes_data, center, name):
'''
Visualise the principal axes being used for the calculation.
vis : the format to write the axes out as (either 'vmd' or 'pymol')
axes_data : the array containing the three principal axes
center : the geometric center of the users... | 45.367347 | 136 | 0.41408 |
097bd75f4256d00841235b8a0c2badf9fdcc555e | 3,743 | py | Python | scripts/lib/xpedite/jupyter/plot.py | dhruvshekhawat/Xpedite | e857cb623e22a4384265dafa8e8437f038f77b95 | [
"Apache-2.0"
] | 99 | 2018-06-29T23:22:36.000Z | 2020-12-10T23:40:10.000Z | scripts/lib/xpedite/jupyter/plot.py | dhruvshekhawat/Xpedite | e857cb623e22a4384265dafa8e8437f038f77b95 | [
"Apache-2.0"
] | 105 | 2018-07-01T23:10:15.000Z | 2020-09-26T16:40:36.000Z | scripts/lib/xpedite/jupyter/plot.py | dhruvshekhawat/Xpedite | e857cb623e22a4384265dafa8e8437f038f77b95 | [
"Apache-2.0"
] | 31 | 2018-06-30T00:28:46.000Z | 2020-11-06T07:29:03.000Z | """
Visualizer for transaction level timing and pmc statistics
This module helps to generate
1. Sunburst visualization to provide a hierarchical view of txn timeline
2. Bipartite visualization to correlate pmc data with sections of code
Author: Dhruv Shekhawat, Morgan Stanley
"""
import json
class NodeNameFacto... | 35.311321 | 109 | 0.725888 |
3a3c22e1701f3538dc078cdf3ae7f8fa3d0464db | 2,071 | py | Python | backend/usd_backend/usd_rest_api/serializers.py | Reevo55/usd-project | 25c967620a3d0b7b2a8da72ba9ec5b9e02a5ee69 | [
"MIT"
] | null | null | null | backend/usd_backend/usd_rest_api/serializers.py | Reevo55/usd-project | 25c967620a3d0b7b2a8da72ba9ec5b9e02a5ee69 | [
"MIT"
] | null | null | null | backend/usd_backend/usd_rest_api/serializers.py | Reevo55/usd-project | 25c967620a3d0b7b2a8da72ba9ec5b9e02a5ee69 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from django.contrib.auth.models import User
from . import models
class EventSerializer(serializers.ModelSerializer):
class Meta:
model = models.Event
fields = ('id', 'when', 'start_time', 'end_time', 'name', 'place', 'notes', 'account')
class AccountEventSe... | 28.763889 | 116 | 0.655722 |
e0233a25c1efa4a63c3d36756fe442f67afc1760 | 23,989 | py | Python | lib/events.py | GraciousGpal/Colony-Server | f57487c913904bdf2e4679c99b666ce1f64615ab | [
"MIT"
] | 1 | 2021-06-27T18:58:08.000Z | 2021-06-27T18:58:08.000Z | lib/events.py | GraciousGpal/Colony-Server | f57487c913904bdf2e4679c99b666ce1f64615ab | [
"MIT"
] | null | null | null | lib/events.py | GraciousGpal/Colony-Server | f57487c913904bdf2e4679c99b666ce1f64615ab | [
"MIT"
] | null | null | null | from asyncio import sleep
from logging import getLogger
from sys import exit as sys_exit
from xml.etree import ElementTree as Et
from lxml import objectify
import lib.definitions as d
from lib.admin import is_mod
from lib.config import get_config
from lib.definitions import Room
# Load Configuration
from lib.exceptio... | 34.075284 | 116 | 0.554546 |
a61845423704a8de6a0d6794ce9655bcb2a68974 | 774 | py | Python | ptm/__manifest__.py | aaparicio87/Odoo11 | 2377ad250920461a1440d11e80d11fc913f7a2c6 | [
"MIT"
] | null | null | null | ptm/__manifest__.py | aaparicio87/Odoo11 | 2377ad250920461a1440d11e80d11fc913f7a2c6 | [
"MIT"
] | null | null | null | ptm/__manifest__.py | aaparicio87/Odoo11 | 2377ad250920461a1440d11e80d11fc913f7a2c6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
{
'name': "Plan de Trabajo Mensual",
'summary': """
Gestiona planes de trabajos del mes""",
'description': """
* Modelo 2
* Modelo 3
* Resumen """,
'author': "EPIA ONCE",
'website': "https://www.epiaonce.cu",
'category': 'Extra Tools'... | 22.114286 | 57 | 0.552972 |
874075a969646297b82da9b94751c08b16d04d38 | 275 | py | Python | music/views.py | 12DReflections/django2 | a0176331bac714d6dcbb3e736330eead6bc54314 | [
"MIT"
] | null | null | null | music/views.py | 12DReflections/django2 | a0176331bac714d6dcbb3e736330eead6bc54314 | [
"MIT"
] | null | null | null | music/views.py | 12DReflections/django2 | a0176331bac714d6dcbb3e736330eead6bc54314 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("<h1>This is a music website</h1>")
def detail(request, album_id):
return HttpResponse("<h2>Details for view</h2>" + str(album_id)) | 27.5 | 65 | 0.76 |
6b30952ff0509bdec0760bb7a7ea33ffbbf0cfc3 | 105 | py | Python | Solutions/7kyu/7kyu_complete_the_pattern4.py | citrok25/Codewars-1 | dc641c5079e2e8b5955eb027fd15427e5bdb2e26 | [
"MIT"
] | 46 | 2017-08-24T09:27:57.000Z | 2022-02-25T02:24:33.000Z | Solutions/7kyu/7kyu_complete_the_pattern4.py | abbhishek971/Codewars | 9e761811db724da1e8aae44594df42b4ee879a16 | [
"MIT"
] | null | null | null | Solutions/7kyu/7kyu_complete_the_pattern4.py | abbhishek971/Codewars | 9e761811db724da1e8aae44594df42b4ee879a16 | [
"MIT"
] | 35 | 2017-08-01T22:09:48.000Z | 2022-02-18T17:21:37.000Z | def pattern(n):
l=list(range(1,n+1))
return '\n'.join(''.join(map(str,l[i:])) for i in range(n))
| 26.25 | 63 | 0.561905 |
6dcc0e94727955a96a466a1a03d5fa6d83338983 | 2,955 | py | Python | tests/aggregate/test_o2m_o2m_o2m.py | lnielsen/sqlalchemy-utils | eb5e17630a4e1077839a56e09d94e1928191cc1c | [
"BSD-3-Clause"
] | 1 | 2015-07-06T11:19:11.000Z | 2015-07-06T11:19:11.000Z | tests/aggregate/test_o2m_o2m_o2m.py | joshfriend/sqlalchemy-utils | 6f3af3ee7539b7fa4a8d823f258606a83f7007d6 | [
"BSD-3-Clause"
] | null | null | null | tests/aggregate/test_o2m_o2m_o2m.py | joshfriend/sqlalchemy-utils | 6f3af3ee7539b7fa4a8d823f258606a83f7007d6 | [
"BSD-3-Clause"
] | null | null | null | import sqlalchemy as sa
from sqlalchemy_utils import aggregated
from tests import TestCase
class Test3LevelDeepOneToMany(TestCase):
dns = 'postgres://postgres@localhost/sqlalchemy_utils_test'
def create_models(self):
class Catalog(self.Base):
__tablename__ = 'catalog'
id = sa.... | 33.579545 | 79 | 0.610491 |
aa663de05ad9a17cd8581e31515531c63893d84d | 1,253 | py | Python | tests/samples/exception.py | jonathangjertsen/PySnooper | 03192c28c229fb6b180b955ee5468e1fcaed617c | [
"MIT"
] | 2 | 2020-10-08T12:04:56.000Z | 2021-01-29T09:39:05.000Z | tests/samples/exception.py | GuilinF/PySnooper | 487fa5317e7f9a0f9bd9dd1abe0fd473610266f4 | [
"MIT"
] | null | null | null | tests/samples/exception.py | GuilinF/PySnooper | 487fa5317e7f9a0f9bd9dd1abe0fd473610266f4 | [
"MIT"
] | null | null | null | import pysnooper
def foo():
raise TypeError('bad')
def bar():
try:
foo()
except Exception:
str(1)
raise
@pysnooper.snoop(depth=3)
def main():
try:
bar()
except:
pass
expected_output = '''
Source path:... Whatever
12:18:08.017782 call 17 def main... | 25.06 | 65 | 0.533121 |
fb87d1486f87dbd129427e03f52619daefbbafa1 | 6,354 | py | Python | ros_ws/src/crazyswarm/externalDependencies/libmotioncapture/deps/vrpn/python_vrpn/vrpn_glview.py | rasmus-rudling/crazyswarm | 1326fbc679061f64a8632a6553a9d6ae269bc1a4 | [
"MIT"
] | 1 | 2021-10-20T22:55:12.000Z | 2021-10-20T22:55:12.000Z | vrpn/python_vrpn/vrpn_glview.py | deakinshaun/UniCAVE-Deakin | 8dc184d7dd598d4554627b8564cae99975ef3dc2 | [
"MIT"
] | null | null | null | vrpn/python_vrpn/vrpn_glview.py | deakinshaun/UniCAVE-Deakin | 8dc184d7dd598d4554627b8564cae99975ef3dc2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Small program to examine positional data from a VRPN tracker
#
# Requirements:
# apt-get install python-qt python-qt-gl
#
import sys
import math
import time
import optparse
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtOpenGL import *
from OpenGL.GL import *
from OpenGL.... | 23.189781 | 92 | 0.541076 |
074cac1131ac9c8c57b8c92d7ac1512d578ebc4e | 226 | py | Python | run.py | larryworm1127/tic-tac-toe-python | 327b43d36948fc41ef9c902f40c7f67fab793b89 | [
"MIT"
] | null | null | null | run.py | larryworm1127/tic-tac-toe-python | 327b43d36948fc41ef9c902f40c7f67fab793b89 | [
"MIT"
] | null | null | null | run.py | larryworm1127/tic-tac-toe-python | 327b43d36948fc41ef9c902f40c7f67fab793b89 | [
"MIT"
] | null | null | null | """
Module that runs the entire game
"""
from ttt_game.ttt_gui import game_loop
from ttt_game.ttt_computer import get_move
from ttt_game.ttt_board import PLAYERO
if __name__ == '__main__':
game_loop(3, PLAYERO, get_move)
| 22.6 | 42 | 0.778761 |
6853e90e02509e76a1b3be27f0cf80949627fff2 | 3,756 | py | Python | lib/streamlit/js_number.py | cdeil/streamlit | 173aa1cd5835174620e8246eb5d7116be2cb6ffc | [
"Apache-2.0"
] | 5 | 2020-07-06T21:29:56.000Z | 2022-03-12T20:04:27.000Z | lib/streamlit/js_number.py | cdeil/streamlit | 173aa1cd5835174620e8246eb5d7116be2cb6ffc | [
"Apache-2.0"
] | 108 | 2020-11-10T22:19:28.000Z | 2022-03-29T16:48:55.000Z | lib/streamlit/js_number.py | cdeil/streamlit | 173aa1cd5835174620e8246eb5d7116be2cb6ffc | [
"Apache-2.0"
] | 3 | 2020-07-14T23:32:51.000Z | 2021-12-04T16:49:29.000Z | # Copyright 2018-2020 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 33.238938 | 88 | 0.617945 |
9cf7b62695d49eff787bb8807ed24c29d29d6ce4 | 1,686 | py | Python | qp.py | yuezhilanyi/fgo-bot | 6076866112327d0fe48323be0ba0b0a6ae97c318 | [
"MIT"
] | 2 | 2020-01-15T02:03:08.000Z | 2020-01-17T03:57:12.000Z | qp.py | yuezhilanyi/fgo-bot | 6076866112327d0fe48323be0ba0b0a6ae97c318 | [
"MIT"
] | null | null | null | qp.py | yuezhilanyi/fgo-bot | 6076866112327d0fe48323be0ba0b0a6ae97c318 | [
"MIT"
] | 1 | 2020-01-17T08:23:18.000Z | 2020-01-17T08:23:18.000Z | import logging
import datetime
import argparse
from fgobot import BattleBot
# 指定日志的输出等级(DEBUG / INFO / WARNING / ERROR)
logging.basicConfig(level=logging.INFO)
# 实例化一个bot
bot = BattleBot(
# 要打的关卡截图为'qp.png',放在这个文件的同一级目录下
quest='qp.png',
# 需要的助战截图为'friend_qp.png',放在这个文件的同一级目录下
# 如果可以接受的助战有多个,可以传入... | 21.075 | 95 | 0.662515 |
8b23bb36f70e9119b5e07d1c4eb60626dd2711da | 341 | py | Python | setup.py | edges-collab/edges-cal | 9b7b28f71e1aa5347f901af38ef3bc0d28766e21 | [
"MIT"
] | 1 | 2021-02-20T14:12:23.000Z | 2021-02-20T14:12:23.000Z | setup.py | edges-collab/edges-cal | 9b7b28f71e1aa5347f901af38ef3bc0d28766e21 | [
"MIT"
] | 86 | 2020-02-07T23:00:23.000Z | 2022-03-31T22:08:19.000Z | setup.py | edges-collab/edges_calib_cli | 42e356e2a121f0a793c15c355c78088e20bcce4f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Setup the package."""
from pkg_resources import VersionConflict, require
from setuptools import setup
import sys
try:
require("setuptools>=38.3")
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)
if __name__ == "__main__":
setup(... | 20.058824 | 61 | 0.695015 |
a09afd1646abdf25d41fdfb278b54398d8ace1c3 | 6,004 | bzl | Python | third_party/python.bzl | Digitaltransform/tensorboard | 75a3c4a8edaa64860951b5fec830accf53993510 | [
"Apache-2.0"
] | 1 | 2022-03-07T14:18:22.000Z | 2022-03-07T14:18:22.000Z | third_party/python.bzl | Digitaltransform/tensorboard | 75a3c4a8edaa64860951b5fec830accf53993510 | [
"Apache-2.0"
] | 52 | 2021-09-30T21:25:24.000Z | 2021-12-22T18:43:58.000Z | third_party/python.bzl | admariner/tensorboard | 931fdb84ed125efe5ef6cb0bad869c52da73e18f | [
"Apache-2.0"
] | 1 | 2020-12-13T22:11:50.000Z | 2020-12-13T22:11:50.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 48.813008 | 168 | 0.689707 |
c1b60f6578876b08c8617de2a64b071b24dc1605 | 27,494 | py | Python | mmdet/models/backbones/dynamic_hrnet.py | dmy1997/DHRNet | a1adeade8075758f940f5c9edda4393d3f67426c | [
"Apache-2.0"
] | null | null | null | mmdet/models/backbones/dynamic_hrnet.py | dmy1997/DHRNet | a1adeade8075758f940f5c9edda4393d3f67426c | [
"Apache-2.0"
] | 1 | 2021-03-26T07:19:51.000Z | 2021-05-21T05:36:12.000Z | mmdet/models/backbones/dynamic_hrnet.py | dmy1997/DHRNet | a1adeade8075758f940f5c9edda4393d3f67426c | [
"Apache-2.0"
] | null | null | null | # full connected like hrnet
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmdet.utils import get_root_logger
from ..registry import BACKBONES
from mmdet.... | 39.053977 | 123 | 0.490325 |
cbcf39bef7bddc5ef9e8d0686992799adb2dc4f4 | 980 | py | Python | tests/test_des3.py | inexio/pysnmpcrypto | 85380d33cabcee4aee5da53927708fe8b894a643 | [
"BSD-2-Clause"
] | 2 | 2018-12-18T07:21:30.000Z | 2020-11-19T19:46:17.000Z | tests/test_des3.py | inexio/pysnmpcrypto | 85380d33cabcee4aee5da53927708fe8b894a643 | [
"BSD-2-Clause"
] | 3 | 2018-07-04T06:50:42.000Z | 2019-02-26T07:49:09.000Z | tests/test_des3.py | inexio/pysnmpcrypto | 85380d33cabcee4aee5da53927708fe8b894a643 | [
"BSD-2-Clause"
] | 3 | 2020-12-22T11:27:54.000Z | 2021-11-12T12:15:39.000Z | #
# This file is part of pysnmpcrypto software.
#
# Copyright (c) 2018-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pysnmp/license.html
#
import sys
import unittest
from pysnmpcrypto import des3
class Des3CaseBase(unittest.TestCase):
def setUp(self):
self.plaintext = b'quick brow... | 28.823529 | 72 | 0.691837 |
6c8f3876af130f053fa6f1bb0ee1cc6907ecd61d | 818 | py | Python | ImageSegmentation/deeplabv3.py | yangcheng/android-demo-app | e29d503141d6f212e2cdc955149cee9fc717bbb9 | [
"Unlicense"
] | 815 | 2019-10-10T15:40:38.000Z | 2022-03-30T14:57:06.000Z | ImageSegmentation/deeplabv3.py | yangcheng/android-demo-app | e29d503141d6f212e2cdc955149cee9fc717bbb9 | [
"Unlicense"
] | 185 | 2019-10-11T10:02:05.000Z | 2022-03-25T15:06:50.000Z | ImageSegmentation/deeplabv3.py | yangcheng/android-demo-app | e29d503141d6f212e2cdc955149cee9fc717bbb9 | [
"Unlicense"
] | 385 | 2019-10-11T05:36:37.000Z | 2022-03-31T09:55:55.000Z | import torch
from torch.utils.mobile_optimizer import optimize_for_mobile
model = torch.hub.load('pytorch/vision:v0.9.0', 'deeplabv3_resnet50', pretrained=True)
model.eval()
scripted_module = torch.jit.script(model)
optimized_scripted_module = optimize_for_mobile(scripted_module)
# Export full jit version model (not... | 51.125 | 183 | 0.838631 |
cb27dfef42733fd58cf6c761cf3f8b734d55e7df | 3,317 | py | Python | abc194/f.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | 1 | 2021-03-09T04:28:13.000Z | 2021-03-09T04:28:13.000Z | abc194/f.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | abc194/f.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null |
# included from snippets/main.py
def debug(*x, msg=""):
import sys
print(msg, *x, file=sys.stderr)
def solve_TLE(N, K):
MOD = 1_000_000_007
D = 2 ** 16
less = [0] * D
equal = 0
for digit in N:
digit = int(digit, 16)
new_less = [0] * D
less[0] += less[1]
les... | 19.981928 | 59 | 0.472113 |
726cec77bcd5e3e08ede316e4bb208c10a552bdd | 8,378 | py | Python | docs/conf.py | grnydawn/jharyo | 2b66bb79995d5ebb1ceaeaa3fbb07f133ec8b8b3 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | grnydawn/jharyo | 2b66bb79995d5ebb1ceaeaa3fbb07f133ec8b8b3 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | grnydawn/jharyo | 2b66bb79995d5ebb1ceaeaa3fbb07f133ec8b8b3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# jharyo documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 30.355072 | 76 | 0.714729 |
67ebf2bcf19ca29f98793d9e655d750dccbd7607 | 111 | py | Python | myia/opt/__init__.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | myia/opt/__init__.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | myia/opt/__init__.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Optimization submodule."""
from .cse import *
from .dde import *
from .opt import *
from .rewrite import *
| 15.857143 | 29 | 0.693694 |
4931ad568353f19242545cfe9a70030ae13393be | 2,725 | py | Python | Classification/Classification.py | vinayak1998/Preprocessing-and-Classification-Template | 16f24140414a88cfce10bf13c857244feaa2735a | [
"MIT"
] | null | null | null | Classification/Classification.py | vinayak1998/Preprocessing-and-Classification-Template | 16f24140414a88cfce10bf13c857244feaa2735a | [
"MIT"
] | null | null | null | Classification/Classification.py | vinayak1998/Preprocessing-and-Classification-Template | 16f24140414a88cfce10bf13c857244feaa2735a | [
"MIT"
] | null | null | null | # Classification template
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Social_Network_Ads.csv')
X = dataset.iloc[:, [2, 3]].values
y = dataset.iloc[:, 4].values
# Splitting the dataset into the Training set and Test se... | 37.847222 | 105 | 0.681468 |
44929c8de75ea76b76fa06c88c7b3b4e3c9c4e5c | 11,545 | py | Python | allennlp/tests/modules/conditional_random_field_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 65 | 2020-11-13T05:36:29.000Z | 2022-03-26T22:45:46.000Z | allennlp/tests/modules/conditional_random_field_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 11 | 2021-05-26T16:22:17.000Z | 2022-03-02T04:03:18.000Z | allennlp/tests/modules/conditional_random_field_test.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 10 | 2019-12-06T11:32:37.000Z | 2022-01-06T15:39:09.000Z | # pylint: disable=no-self-use,invalid-name
import itertools
import math
from pytest import approx, raises
import torch
from allennlp.modules import ConditionalRandomField
from allennlp.modules.conditional_random_field import allowed_transitions
from allennlp.common.checks import ConfigurationError
from allennlp.commo... | 46.18 | 110 | 0.478389 |
7f917b0f3645d883b5c751bd66d8b26dcb3003f3 | 357 | py | Python | configs/ocrnet/ocrnet_s101-d8_512x1024_40k_b8_cityscapes.py | cocolord/mmsegmentation | 45db7269d7aa40f8aac5ddaabf7e1b4b01353ca5 | [
"Apache-2.0"
] | null | null | null | configs/ocrnet/ocrnet_s101-d8_512x1024_40k_b8_cityscapes.py | cocolord/mmsegmentation | 45db7269d7aa40f8aac5ddaabf7e1b4b01353ca5 | [
"Apache-2.0"
] | null | null | null | configs/ocrnet/ocrnet_s101-d8_512x1024_40k_b8_cityscapes.py | cocolord/mmsegmentation | 45db7269d7aa40f8aac5ddaabf7e1b4b01353ca5 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/models/ocrnet_r50-d8.py', '../_base_/datasets/cityscapes.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py'
]
model = dict(pretrained='open-mmlab://resnest101', backbone=dict(
type='ResNeSt',
stem_channels=128,
radix=2,
reduction_fact... | 32.454545 | 76 | 0.641457 |
fa512d37f6e75e988cf03403bab2602d98f82245 | 22,668 | py | Python | pygments/lexers/ruby.py | blu-base/pygments | da799d14818ed538bf937684a19ce779ddde9446 | [
"BSD-2-Clause"
] | 1 | 2015-06-08T14:52:49.000Z | 2015-06-08T14:52:49.000Z | pygments/lexers/ruby.py | blu-base/pygments | da799d14818ed538bf937684a19ce779ddde9446 | [
"BSD-2-Clause"
] | 1 | 2022-03-13T09:17:24.000Z | 2022-03-13T09:18:02.000Z | pygments/lexers/ruby.py | blu-base/pygments | da799d14818ed538bf937684a19ce779ddde9446 | [
"BSD-2-Clause"
] | null | null | null | """
pygments.lexers.ruby
~~~~~~~~~~~~~~~~~~~~
Lexers for Ruby and related languages.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, include, \
bygroups,... | 43.259542 | 98 | 0.433475 |
5b4c1039ef78b675f5a06dbcad1a6081acab4da7 | 8,466 | py | Python | tools/accuracy_checker/accuracy_checker/launcher/launcher.py | ivanvikhrev/open_model_zoo | 322e7ac5ed8a17611b56c46e5e56bfef05d8cc2a | [
"Apache-2.0"
] | 4 | 2019-09-17T13:11:02.000Z | 2021-02-22T15:39:15.000Z | tools/accuracy_checker/accuracy_checker/launcher/launcher.py | ivanvikhrev/open_model_zoo | 322e7ac5ed8a17611b56c46e5e56bfef05d8cc2a | [
"Apache-2.0"
] | null | null | null | tools/accuracy_checker/accuracy_checker/launcher/launcher.py | ivanvikhrev/open_model_zoo | 322e7ac5ed8a17611b56c46e5e56bfef05d8cc2a | [
"Apache-2.0"
] | 1 | 2022-01-12T03:47:00.000Z | 2022-01-12T03:47:00.000Z | """
Copyright (c) 2018-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 38.307692 | 115 | 0.650721 |
746c2d67b74b2f9712ec1cda7a47416761bf6ca5 | 2,664 | py | Python | tests/distributions/test_1d_dependencies.py | Novermars/chaospy | 800f26203c21ee69c61bdba6a53f6cbede653167 | [
"MIT"
] | null | null | null | tests/distributions/test_1d_dependencies.py | Novermars/chaospy | 800f26203c21ee69c61bdba6a53f6cbede653167 | [
"MIT"
] | null | null | null | tests/distributions/test_1d_dependencies.py | Novermars/chaospy | 800f26203c21ee69c61bdba6a53f6cbede653167 | [
"MIT"
] | null | null | null | """Test dependent distributions with 1-D components."""
from pytest import raises
import numpy
import chaospy
DIST1 = chaospy.Uniform(1, 2)
DIST2 = chaospy.Gamma(DIST1)
JOINT1 = chaospy.J(DIST1, DIST2)
JOINT2 = chaospy.J(DIST2, DIST1)
def test_1d_stochastic_dependencies():
"""Ensure ``stochastic_dependencies`` b... | 39.176471 | 98 | 0.698574 |
5874de122a68ffd421ee59b58033a57d2d0cc995 | 7,718 | py | Python | chaos_genius/controllers/task_monitor.py | eltociear/chaos_genius | eb3bc27181c8af4144b95e685386814109173164 | [
"MIT"
] | 320 | 2022-02-18T18:18:42.000Z | 2022-03-31T16:42:38.000Z | chaos_genius/controllers/task_monitor.py | eltociear/chaos_genius | eb3bc27181c8af4144b95e685386814109173164 | [
"MIT"
] | 115 | 2022-02-18T16:39:01.000Z | 2022-03-31T15:23:52.000Z | chaos_genius/controllers/task_monitor.py | eltociear/chaos_genius | eb3bc27181c8af4144b95e685386814109173164 | [
"MIT"
] | 18 | 2022-02-18T18:44:01.000Z | 2022-03-10T08:33:34.000Z | """Utilities for logging and monitoring tasks."""
import traceback
from typing import List, Optional
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonTracebackLexer
from pygments.style import Style
from pygments.token import Generic, Name, Number
from sqla... | 33.850877 | 129 | 0.631381 |
94fec2062ec41b5ecfd557db8dba5409fde3d86a | 14,758 | py | Python | dds_web/api/db_connector.py | pericsson/dds_web | 60e4436b94e1999e09a1f2b81520384b204dc8df | [
"BSD-3-Clause"
] | null | null | null | dds_web/api/db_connector.py | pericsson/dds_web | 60e4436b94e1999e09a1f2b81520384b204dc8df | [
"BSD-3-Clause"
] | null | null | null | dds_web/api/db_connector.py | pericsson/dds_web | 60e4436b94e1999e09a1f2b81520384b204dc8df | [
"BSD-3-Clause"
] | null | null | null | """API DB Connector module"""
###############################################################################
# IMPORTS ########################################################### IMPORTS #
###############################################################################
# Standard library
import traceback
import os
im... | 35.138095 | 100 | 0.512129 |
747e3339459af38940bd77f99c76adda1f8d4f60 | 462 | py | Python | src/outpost/django/redirect/urls.py | medunigraz/outpost.django.redirect | 3e732e95725c0c0079ca5328401bb9f51b1ff872 | [
"BSD-2-Clause"
] | null | null | null | src/outpost/django/redirect/urls.py | medunigraz/outpost.django.redirect | 3e732e95725c0c0079ca5328401bb9f51b1ff872 | [
"BSD-2-Clause"
] | null | null | null | src/outpost/django/redirect/urls.py | medunigraz/outpost.django.redirect | 3e732e95725c0c0079ca5328401bb9f51b1ff872 | [
"BSD-2-Clause"
] | null | null | null | from django.conf.urls import url
from . import views
app_name = "redirect"
urlpatterns = [
url(r"^create/$", views.CreateView.as_view(), name="create"),
url(r"^edit/(?P<pk>\d+)/$", views.UpdateView.as_view(), name="edit"),
url(r"^delete/(?P<pk>\d+)/$", views.DeleteView.as_view(), name="delete"),... | 33 | 80 | 0.603896 |
37bbc36a050d7fd86b33d09bc8dce9cb4c790772 | 975 | py | Python | stackhut_toolkit/manager.py | StackHut/StackHut | f199a4d3de4ddb9d9199412aa8473aae3d27d7f0 | [
"Apache-2.0"
] | 1 | 2015-11-09T07:51:21.000Z | 2015-11-09T07:51:21.000Z | stackhut_toolkit/manager.py | StackHut/StackHut | f199a4d3de4ddb9d9199412aa8473aae3d27d7f0 | [
"Apache-2.0"
] | 10 | 2015-10-12T17:20:33.000Z | 2015-11-09T14:16:12.000Z | stackhut_toolkit/manager.py | StackHut/StackHut | f199a4d3de4ddb9d9199412aa8473aae3d27d7f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 StackHut Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 24.375 | 74 | 0.701538 |
a3fcb1c0c20cfc6644a7a9f7b1dd16c2687f4edb | 890 | py | Python | mkt/site/urls.py | spasovski/zamboni | c7f4714029e3b2dc918ddfc2103f8e051193c14d | [
"BSD-3-Clause"
] | 1 | 2017-07-14T19:22:39.000Z | 2017-07-14T19:22:39.000Z | mkt/site/urls.py | imclab/olympia | 35bc9c484e384bafab520ca8b5d5b0f8da5b62c0 | [
"BSD-3-Clause"
] | 6 | 2021-02-02T23:08:48.000Z | 2021-09-08T02:47:17.000Z | mkt/site/urls.py | imclab/olympia | 35bc9c484e384bafab520ca8b5d5b0f8da5b62c0 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url('^mozmarket.js$', views.mozmarket_js, name='site.mozmarket_js'),
url('^robots.txt$', views.robots, name='robots.txt'),
# Replace opensearch.xml from amo with a specific one for Marketplace.
url('^opensearch... | 37.083333 | 77 | 0.686517 |
319d4bccde369a93a3864a3b5bee05881de5301a | 76 | py | Python | ABC101/ABC101f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC101/ABC101f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC101/ABC101f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | #ABC101f
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| 15.2 | 28 | 0.789474 |
1e6e6795b362768c480fb325a4722903846c1898 | 146 | py | Python | FirstStepsInPython/Fundamentals/Lab/Regular Expressions/01. Match Full Name.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Fundamentals/Lab/Regular Expressions/01. Match Full Name.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | null | null | null | FirstStepsInPython/Fundamentals/Lab/Regular Expressions/01. Match Full Name.py | Pittor052/SoftUni-Studies | 1ee6341082f6ccfa45b3e82824c37722bcf2fb31 | [
"MIT"
] | 1 | 2021-10-07T18:30:42.000Z | 2021-10-07T18:30:42.000Z | import re
line_input = input()
pattern = r"\b[A-Z]{1}[a-z]+ [A-Z]{1}[a-z]+\b"
valid_names = re.findall(pattern, line_input)
print(*valid_names) | 18.25 | 46 | 0.657534 |
ec8638720df08ffe8384efeedd72712c693f6544 | 20,097 | py | Python | python_modules/dagster/dagster_tests/core_tests/system_config_tests/test_system_config.py | alexismanuel/dagster | b2cdf8cc985ad48ff203b44b664ff3cb4aded9a3 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/system_config_tests/test_system_config.py | alexismanuel/dagster | b2cdf8cc985ad48ff203b44b664ff3cb4aded9a3 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/system_config_tests/test_system_config.py | alexismanuel/dagster | b2cdf8cc985ad48ff203b44b664ff3cb4aded9a3 | [
"Apache-2.0"
] | null | null | null | import re
from dagster import (
Any,
DependencyDefinition,
Field,
InputDefinition,
Int,
ModeDefinition,
OutputDefinition,
PipelineDefinition,
ResourceDefinition,
Shape,
SolidDefinition,
SolidInvocation,
String,
execute_pipeline,
lambda_solid,
pipeline,
... | 31.303738 | 100 | 0.643977 |
cbef05577df8467adccfcf3bed0c1026d61e3d12 | 2,619 | py | Python | lib/dataset/mpii.py | Nyquixt/multiview-human-pose-estimation-pytorch | d1469ee19f1761281aa738287c6fca0fb1fd9866 | [
"MIT"
] | 479 | 2019-08-29T10:14:51.000Z | 2022-03-21T05:33:44.000Z | lib/dataset/mpii.py | Nyquixt/multiview-human-pose-estimation-pytorch | d1469ee19f1761281aa738287c6fca0fb1fd9866 | [
"MIT"
] | 46 | 2019-09-06T02:19:24.000Z | 2022-03-06T11:58:37.000Z | lib/dataset/mpii.py | Nyquixt/multiview-human-pose-estimation-pytorch | d1469ee19f1761281aa738287c6fca0fb1fd9866 | [
"MIT"
] | 86 | 2019-09-02T06:16:58.000Z | 2022-01-17T10:40:23.000Z | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Written by Chunyu Wang (chnuwa@microsoft.com)
# ------------------------------------------------------------------------------
from __future__... | 29.761364 | 80 | 0.455136 |
60ef92f4c270fbc551d3894b993f44e7bb5e9053 | 1,339 | py | Python | 1001-1100/1095-Find in Mountain Array/1095-Find in Mountain Array.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 1001-1100/1095-Find in Mountain Array/1095-Find in Mountain Array.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 1001-1100/1095-Find in Mountain Array/1095-Find in Mountain Array.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | # """
# This is MountainArray's API interface.
# You should not implement it, or speculate about its implementation
# """
#class MountainArray:
# def get(self, index: int) -> int:
# def length(self) -> int:
import math
class Solution:
def findInMountainArray(self, target: int, mountain_arr: 'MountainArray') ... | 29.108696 | 85 | 0.440627 |
9ce5fb307b63581d51758cf97b10bb61358ac5c1 | 792 | py | Python | testrunner/pypyjit_tests.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | null | null | null | testrunner/pypyjit_tests.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | null | null | null | testrunner/pypyjit_tests.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | #!/usr/bin/env python
"""
This is what the buildbot runs to execute the pypyjit tests
on top of pypy-c.
"""
import json
import sys, os
import subprocess
rootdir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
os.environ['PYTHONPATH'] = rootdir
os.environ['PYTEST_PLUGINS'] = ''
config_json = subproce... | 22.628571 | 81 | 0.691919 |
4bd049673467ff010fb4d64a0e604cc4eba88f59 | 1,727 | py | Python | archivebox/parsers/generic_rss.py | sarvex/ArchiveBox | 2427e6d3dc377c665f785f1d845da4e5a20b50a0 | [
"MIT"
] | 6,340 | 2018-12-20T21:12:13.000Z | 2020-11-23T02:39:32.000Z | archivebox/parsers/generic_rss.py | sarvex/ArchiveBox | 2427e6d3dc377c665f785f1d845da4e5a20b50a0 | [
"MIT"
] | 388 | 2018-12-20T07:58:08.000Z | 2020-11-23T03:20:36.000Z | archivebox/parsers/generic_rss.py | sarvex/ArchiveBox | 2427e6d3dc377c665f785f1d845da4e5a20b50a0 | [
"MIT"
] | 439 | 2018-12-21T21:51:47.000Z | 2020-11-21T21:21:35.000Z | __package__ = 'archivebox.parsers'
from typing import IO, Iterable
from datetime import datetime
from ..index.schema import Link
from ..util import (
htmldecode,
enforce_types,
str_between,
)
@enforce_types
def parse_generic_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse RSS XM... | 31.4 | 83 | 0.598726 |
a5839868568f15d7f2149e023882de016a3df4a2 | 17,141 | py | Python | openstackclient/network/v2/subnet_pool.py | keiichi-hikita/python-openstackclient | 77a533f277e435c936da591fa5b51e9c822704b6 | [
"Apache-2.0"
] | 1 | 2018-04-23T20:59:31.000Z | 2018-04-23T20:59:31.000Z | openstackclient/network/v2/subnet_pool.py | adgeese/python-openstackclient | 06263bd5852aad9cd03a76f50140fbbb2d0751ba | [
"Apache-2.0"
] | null | null | null | openstackclient/network/v2/subnet_pool.py | adgeese/python-openstackclient | 06263bd5852aad9cd03a76f50140fbbb2d0751ba | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distrib... | 35.784969 | 79 | 0.608074 |
3279e47b5654a7abb5232101191107a2f369d69a | 8,215 | py | Python | app.py | DoubleX69/Xbill | 2a7a99a2d98c1bb297a4493b56a61f7eb970aa0f | [
"MIT"
] | 14 | 2020-03-15T13:40:02.000Z | 2021-06-15T18:04:08.000Z | app.py | DoubleX69/Xbill | 2a7a99a2d98c1bb297a4493b56a61f7eb970aa0f | [
"MIT"
] | 1 | 2020-05-24T13:14:46.000Z | 2020-05-24T13:14:46.000Z | app.py | DoubleX69/Xbill | 2a7a99a2d98c1bb297a4493b56a61f7eb970aa0f | [
"MIT"
] | 3 | 2020-05-05T00:23:36.000Z | 2021-06-10T01:18:16.000Z | import os
from datetime import datetime
from flask import Flask, render_template, url_for, request
from werkzeug.utils import secure_filename, redirect
from Models import create_table, database
from App import api
app = Flask(__name__)
# This hook ensures that a connection is opened to handle any queries
# generat... | 29.131206 | 116 | 0.640414 |
2ced77e381582f6282a3c510b531cef04205abae | 3,230 | py | Python | benchmark/startCirq3238.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3238.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3238.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=42
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 36.704545 | 77 | 0.678947 |
ce78dac225c25c6b26f19a7b047345e717220901 | 928 | py | Python | scripts/analyze_stackdmp.py | proddy/MyESP | 7619bd91bd72a64791fe52a077ce9b7bfd6ad34b | [
"MIT"
] | null | null | null | scripts/analyze_stackdmp.py | proddy/MyESP | 7619bd91bd72a64791fe52a077ce9b7bfd6ad34b | [
"MIT"
] | null | null | null | scripts/analyze_stackdmp.py | proddy/MyESP | 7619bd91bd72a64791fe52a077ce9b7bfd6ad34b | [
"MIT"
] | 3 | 2019-12-28T20:09:46.000Z | 2020-11-28T09:40:16.000Z | #!/usr/bin/env python
from subprocess import call
import os
# example stackdmp.txt would contain text like below copied & pasted from a 'crash dump' command:
# >>>stack>>>
# 3fffff20: 3fff32f0 00000003 3fff3028 402101b2
# 3fffff30: 3fffdad0 3fff3280 0000000d 402148aa
# 3fffff40: 3fffdad0 3fff3280 3fff326c 3fff32f0
# ... | 38.666667 | 135 | 0.775862 |
e78527fb49f8e196535b8fc8d8557fdecebd01d1 | 3,935 | py | Python | python/lib/lib_care/utils/merge_cloud_results.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | python/lib/lib_care/utils/merge_cloud_results.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | python/lib/lib_care/utils/merge_cloud_results.py | timtyree/bgmc | 891e003a9594be9e40c53822879421c2b8c44eed | [
"MIT"
] | null | null | null | import re,os,pandas as pd, numpy as np
def parse_inputs(line):
result_keys = re.findall(r'\S+=', line)
result_values = re.findall(r'=\d*\.?\d*', line)
input_dict={}
if len(result_values)==0:
return input_dict
if result_keys[0]=='mode':
return input_dict
for k,v in zip(result_key... | 37.47619 | 107 | 0.640407 |
2ec5b9cd2f6fbbdea47840167711ef68a37d33b2 | 122 | py | Python | odoo-13.0/addons/payment_payumoney/models/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/payment_payumoney/models/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | odoo-13.0/addons/payment_payumoney/models/__init__.py | VaibhavBhujade/Blockchain-ERP-interoperability | b5190a037fb6615386f7cbad024d51b0abd4ba03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import payment
| 24.4 | 74 | 0.704918 |
7b0d1dc62fa8187ff8934777165ff09b4789f0d5 | 4,168 | py | Python | aoc_wim/aoc2019/q17.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 20 | 2019-10-15T07:33:13.000Z | 2022-01-19T13:40:36.000Z | aoc_wim/aoc2019/q17.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 5 | 2019-02-01T23:31:27.000Z | 2021-12-03T06:55:58.000Z | aoc_wim/aoc2019/q17.py | wimglenn/advent-of-code-wim | 6308c3fa5d29b318680419f877fd5b8ac1359b5d | [
"WTFPL"
] | 8 | 2019-12-03T15:41:23.000Z | 2021-12-06T17:13:57.000Z | """
--- Day 17: Set and Forget ---
https://adventofcode.com/2019/day/17
"""
from aocd import data
from aoc_wim.aoc2019 import IntComputer
from aoc_wim.zgrid import ZGrid
def parsed(data):
comp = IntComputer(data)
comp.run()
txt = "".join([chr(x) for x in reversed(comp.output)])
grid = ZGrid(txt)
g... | 30.423358 | 78 | 0.508397 |
8088e5387125def07c63bfe8490353bb5f4ca5bd | 4,657 | py | Python | python/ray/autoscaler/docker.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 2 | 2019-06-17T12:38:24.000Z | 2020-11-11T07:52:26.000Z | python/ray/autoscaler/docker.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 3 | 2018-08-15T19:19:25.000Z | 2021-06-30T01:54:46.000Z | python/ray/autoscaler/docker.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 2 | 2017-10-31T23:20:07.000Z | 2019-11-13T20:16:03.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import logging
try: # py3
from shlex import quote
except ImportError: # py2
from pipes import quote
logger = logging.getLogger(__name__)
def dockerize_if_needed(config):
if "docker" n... | 35.549618 | 79 | 0.612626 |
d9aeebdfb01f6b2de7b5d04ff312d2f2c6274a21 | 136 | py | Python | setup.py | dany74q/ctap-keyring-device | 2f41f008679259182a61224680d75b6e0bdc510b | [
"MIT"
] | 1 | 2022-03-04T09:37:49.000Z | 2022-03-04T09:37:49.000Z | setup.py | dany74q/ctap-keyring-device | 2f41f008679259182a61224680d75b6e0bdc510b | [
"MIT"
] | null | null | null | setup.py | dany74q/ctap-keyring-device | 2f41f008679259182a61224680d75b6e0bdc510b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
if __name__ == "__main__":
setuptools.setup(use_scm_version=True)
| 17 | 42 | 0.683824 |
ecdf3eadafb45ea9eeb8c4f81bf5ea7245ecd9b9 | 9,758 | py | Python | local_modules/HamsterModule.py | bison--/eVolution | d3888962a22f30f2779327f19d18bbd0cc1c08fb | [
"MIT"
] | null | null | null | local_modules/HamsterModule.py | bison--/eVolution | d3888962a22f30f2779327f19d18bbd0cc1c08fb | [
"MIT"
] | null | null | null | local_modules/HamsterModule.py | bison--/eVolution | d3888962a22f30f2779327f19d18bbd0cc1c08fb | [
"MIT"
] | null | null | null | from __future__ import annotations
import pygame
import config
import random
from pygame.surface import Surface
from local_modules import BaseModule
class HamsterModule(BaseModule.BaseModule):
def __init__(self, screen: Surface):
super().__init__(screen)
self.the_world = TheWorld()
self.si... | 30.685535 | 117 | 0.61283 |
b47bcbedcba5cc7a98aa6e3f8104123e0b15b1bc | 9,140 | py | Python | on_http_redfish_1_0/models/task_collection_task_collection.py | jlongever/redfish-client-python | 94db1dfa1d9fadf1c000dfab2e89bdb24f8b053c | [
"Apache-2.0"
] | 1 | 2017-02-01T08:25:41.000Z | 2017-02-01T08:25:41.000Z | on_http_redfish_1_0/models/task_collection_task_collection.py | jlongever/redfish-client-python | 94db1dfa1d9fadf1c000dfab2e89bdb24f8b053c | [
"Apache-2.0"
] | null | null | null | on_http_redfish_1_0/models/task_collection_task_collection.py | jlongever/redfish-client-python | 94db1dfa1d9fadf1c000dfab2e89bdb24f8b053c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 29.015873 | 115 | 0.627133 |
4d92d1b30315b9c51b0581aa0f7380760b41606d | 692 | py | Python | bin/django-admin.py | srogers47/Semantic-NLP-News-Site | 79216dc363247aec6ae10109173c22dbebbf5c3f | [
"MIT"
] | null | null | null | bin/django-admin.py | srogers47/Semantic-NLP-News-Site | 79216dc363247aec6ae10109173c22dbebbf5c3f | [
"MIT"
] | 1 | 2022-03-03T21:48:58.000Z | 2022-03-03T21:48:58.000Z | bin/django-admin.py | srogers47/Semantic-NLP-News-Site | 79216dc363247aec6ae10109173c22dbebbf5c3f | [
"MIT"
] | null | null | null | #!/home/jim/projects/Semantic-NLP-News-Site/bin/python3.8
# When the django-admin.py deprecation ends, remove this script.
import warnings
from django.core import management
try:
from django.utils.deprecation import RemovedInDjango40Warning
except ImportError:
raise ImportError(
'django-admin.py was d... | 31.454545 | 80 | 0.725434 |
606aeed714d75d750dad4179f7a6a9f5d65fcc4d | 14,484 | py | Python | dashboard/dashboard_builder.py | elharo/cloud-opensource-python | 14c05855d23fd13cccda8191c4c4aa1e56c16b1e | [
"Apache-2.0"
] | null | null | null | dashboard/dashboard_builder.py | elharo/cloud-opensource-python | 14c05855d23fd13cccda8191c4c4aa1e56c16b1e | [
"Apache-2.0"
] | null | null | null | dashboard/dashboard_builder.py | elharo/cloud-opensource-python | 14c05855d23fd13cccda8191c4c4aa1e56c16b1e | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 36.575758 | 79 | 0.587683 |
c6d6e7d0a67fb891c564c44a7022d884fca4f5f3 | 8,121 | py | Python | tests/test_scheduleparser.py | t0rx/friendly-schedule | 0d77da3ac50a9b0c8f74108bd0f402e45565f145 | [
"MIT"
] | null | null | null | tests/test_scheduleparser.py | t0rx/friendly-schedule | 0d77da3ac50a9b0c8f74108bd0f402e45565f145 | [
"MIT"
] | null | null | null | tests/test_scheduleparser.py | t0rx/friendly-schedule | 0d77da3ac50a9b0c8f74108bd0f402e45565f145 | [
"MIT"
] | null | null | null | """The tests for the ScheduleParser class."""
from datetime import datetime, time, timedelta
import unittest
import friendlyschedule.scheduleparser as sp
class TestScheduleParser(unittest.TestCase):
"""Test the ScheduleParser class."""
# pylint: disable=invalid-name
def setUp(self):
"""Set up t... | 45.623596 | 79 | 0.572959 |
40efcd4827a7caf1b141b58add1a8c5003be567e | 6,573 | py | Python | tests/test_logistic_rl_transe.py | bhaskargautam/record-linkage | 01eb29f8b7fb4dd1625187232f2dafe47f24cddf | [
"MIT"
] | 1 | 2019-06-07T08:33:40.000Z | 2019-06-07T08:33:40.000Z | tests/test_logistic_rl_transe.py | bhaskargautam/record-linkage | 01eb29f8b7fb4dd1625187232f2dafe47f24cddf | [
"MIT"
] | 6 | 2019-09-19T23:30:53.000Z | 2022-02-10T00:07:09.000Z | tests/test_logistic_rl_transe.py | bhaskargautam/record-linkage | 01eb29f8b7fb4dd1625187232f2dafe47f24cddf | [
"MIT"
] | null | null | null | import unittest
import itertools
import pandas as pd
import numpy as np
import recordlinkage
import unittest
from common import (
export_embeddings,
export_result_prob,
get_optimal_threshold,
get_logger,
InformationRetrievalMetrics,
log_quality_results,
sigmoid)
from data.base_census import... | 44.714286 | 116 | 0.590446 |
d069a787ce8cac964b1972f14ddd040a850e65f4 | 40 | py | Python | fulltext/process/tests/__init__.py | arXiv/arxiv-fulltext | 36008457022cde245d78b3ad91e0a95aa21bc420 | [
"MIT"
] | 18 | 2019-03-01T02:51:45.000Z | 2021-11-05T12:26:12.000Z | fulltext/process/tests/__init__.py | arXiv/arxiv-fulltext | 36008457022cde245d78b3ad91e0a95aa21bc420 | [
"MIT"
] | 6 | 2019-05-06T15:25:16.000Z | 2019-07-31T20:11:36.000Z | fulltext/process/tests/__init__.py | arXiv/arxiv-fulltext | 36008457022cde245d78b3ad91e0a95aa21bc420 | [
"MIT"
] | 8 | 2019-01-10T22:01:58.000Z | 2021-11-05T12:26:01.000Z | """Test for :mod:`fulltext.process`."""
| 20 | 39 | 0.625 |
6f783a241aa4ba50c4b5e6e69b4e4384c7335c80 | 1,064 | py | Python | configfilereader.py | trim-uec/notify | c763d87d8654ce46366e9d5bf4d30191fc0db5bf | [
"MIT"
] | null | null | null | configfilereader.py | trim-uec/notify | c763d87d8654ce46366e9d5bf4d30191fc0db5bf | [
"MIT"
] | null | null | null | configfilereader.py | trim-uec/notify | c763d87d8654ce46366e9d5bf4d30191fc0db5bf | [
"MIT"
] | null | null | null | import configparser
import os
# コンフィグファイルの名前とエンコードを受け取って、要求された値を読み込むクラス
# 設定読み込みエラーを吐く責任を持つ。コンフィグが、設計が意図した記述でない場合にエラーを出すこと。
# 設定読み込みメソッドを 「get_型名」 とすることで、設定から何を受け取るかを分かりやすくする
# デバッグオプションONで読み込むたびに出力?
class ConfigFileReader:
# config_file, config
def __init__(self, filepath='config.ini', section='DEFAULT',... | 29.555556 | 83 | 0.694549 |
58d0ab11b1d2e969938f9161ddc04e82fe4bd787 | 3,189 | py | Python | tensorflow/contrib/ffmpeg/decode_audio_op_test.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 680 | 2016-12-03T14:38:28.000Z | 2022-02-16T04:06:45.000Z | tensorflow/contrib/ffmpeg/decode_audio_op_test.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 38 | 2016-11-17T08:43:51.000Z | 2019-11-12T12:27:04.000Z | tensorflow/contrib/ffmpeg/decode_audio_op_test.py | jdehotin/TensorFlow | a6c5f8e4e013e54fed8dfcf49fb6de365f018022 | [
"Apache-2.0"
] | 250 | 2016-12-05T10:37:17.000Z | 2022-03-18T21:26:55.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.081395 | 79 | 0.677328 |
1464c38742ea4ae0a024943bb403fead5688deec | 597 | py | Python | trueSite/blog/admin.py | Alexa201228/math_project | a56cab598aa6a704be6ff54c0102b6a6fcb3c0b7 | [
"bzip2-1.0.6"
] | null | null | null | trueSite/blog/admin.py | Alexa201228/math_project | a56cab598aa6a704be6ff54c0102b6a6fcb3c0b7 | [
"bzip2-1.0.6"
] | null | null | null | trueSite/blog/admin.py | Alexa201228/math_project | a56cab598aa6a704be6ff54c0102b6a6fcb3c0b7 | [
"bzip2-1.0.6"
] | null | null | null | from django.contrib import admin
from .models import Post, PostImages, SocialShares
class PostImageAdmin(admin.StackedInline):
model = PostImages
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ('title', 'slug', 'publish', 'status')
prepopulated_fields = {'slug': ('title', )}
i... | 24.875 | 57 | 0.718593 |
757dc652ff6dcd54ad8dff0b8fb2d53f9ea3364c | 12,249 | py | Python | mesonbuild/compilers/mixins/gnu.py | niacat/meson | 16bc84505e7412442d6848279e701c8077302de8 | [
"Apache-2.0"
] | null | null | null | mesonbuild/compilers/mixins/gnu.py | niacat/meson | 16bc84505e7412442d6848279e701c8077302de8 | [
"Apache-2.0"
] | null | null | null | mesonbuild/compilers/mixins/gnu.py | niacat/meson | 16bc84505e7412442d6848279e701c8077302de8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The meson development 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 ... | 36.673653 | 123 | 0.618091 |
a676f55815cacf0ed13d7d400107634e007b6463 | 1,508 | py | Python | src/pl_data/dataset.py | lucmos/DLAI2021-tutorial | ff4369ab5fcee65eeda7efefa13ac3e038331e56 | [
"MIT"
] | 2 | 2021-05-15T20:17:19.000Z | 2021-11-19T11:40:04.000Z | src/pl_data/dataset.py | lucmos/DLAI2021-tutorial | ff4369ab5fcee65eeda7efefa13ac3e038331e56 | [
"MIT"
] | null | null | null | src/pl_data/dataset.py | lucmos/DLAI2021-tutorial | ff4369ab5fcee65eeda7efefa13ac3e038331e56 | [
"MIT"
] | null | null | null | from typing import Dict, Tuple, Union
import hydra
import omegaconf
import pytorch_lightning as pl
import torch
from omegaconf import ValueNode
from torch.utils.data import Dataset
from torchvision.datasets import CIFAR10
from torchvision.transforms import transforms
from tqdm import tqdm
from src.common.utils import... | 26.928571 | 80 | 0.65252 |
c4bd101f2ac94288053131be566e4cebb936a713 | 1,014 | py | Python | ilpexp/system/metagol/metagol.py | logic-and-learning-lab/Popper-experiments | 94d7499e32c3c9b01da5fd53cddef8a8afa8d509 | [
"MIT"
] | 3 | 2022-01-30T09:51:17.000Z | 2022-03-13T20:04:09.000Z | ilpexp/system/metagol/metagol.py | logic-and-learning-lab/Popper-experiments | 94d7499e32c3c9b01da5fd53cddef8a8afa8d509 | [
"MIT"
] | 5 | 2022-01-30T09:38:12.000Z | 2022-01-31T08:34:49.000Z | ilpexp/system/metagol/metagol.py | logic-and-learning-lab/Popper-experiments | 94d7499e32c3c9b01da5fd53cddef8a8afa8d509 | [
"MIT"
] | null | null | null | from ...util import curr_dir_relative, time_prolog_experiment
from .. import System
METARULES_RECURSIVE = curr_dir_relative('metarules-rec.pl')
METARULES_DEFAULT = curr_dir_relative('metarules.pl')
class Metagol(System):
def __init__(self, name="metagol", id="metagol"):
super().__init__(name, id)
def... | 36.214286 | 108 | 0.701183 |
6092dcebad304b9c8ea513591580308ec0bd8cfe | 1,666 | py | Python | mars/dataframe/execution/tests/test_datasource_execution.py | ChenQuan/mars | 46fc9747e99210cebfabfc2d85bcc8272440d1a3 | [
"Apache-2.0"
] | 1 | 2019-02-01T07:41:48.000Z | 2019-02-01T07:41:48.000Z | mars/dataframe/execution/tests/test_datasource_execution.py | immortalFrogJiang/mars | 93c786e38bdc0fbb483282d7792379db0345a3b6 | [
"Apache-2.0"
] | null | null | null | mars/dataframe/execution/tests/test_datasource_execution.py | immortalFrogJiang/mars | 93c786e38bdc0fbb483282d7792379db0345a3b6 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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 a... | 36.217391 | 95 | 0.708283 |
39a685987c40a1c9d64f85da5843e31570e8cd62 | 5,610 | py | Python | shrinkbench/datasets/datasets.py | marwash25/subpruning | 5361dfd186f061aa155a03d263537cc356529c96 | [
"MIT"
] | 1 | 2022-03-30T21:22:12.000Z | 2022-03-30T21:22:12.000Z | shrinkbench/datasets/datasets.py | marwash25/subpruning | 5361dfd186f061aa155a03d263537cc356529c96 | [
"MIT"
] | null | null | null | shrinkbench/datasets/datasets.py | marwash25/subpruning | 5361dfd186f061aa155a03d263537cc356529c96 | [
"MIT"
] | 1 | 2022-03-30T21:22:16.000Z | 2022-03-30T21:22:16.000Z | import pathlib
import os
from torchvision import transforms, datasets
from . import places365
_constructors = {
'MNIST': datasets.MNIST,
'CIFAR10': datasets.CIFAR10,
'CIFAR100': datasets.CIFAR100,
'ImageNet': datasets.ImageNet,
'Places365': places365.Places365
}
def dataset_path(dataset, path=N... | 34.84472 | 118 | 0.649911 |
1a59e77a376ab7537fa2366a870bcad552d7b7f9 | 91 | py | Python | biotorch/models/backpropagation/__init__.py | jsalbert/biotorch | 74fad0dd32529e754e4bba8298d4e0fd0a06a886 | [
"Apache-2.0"
] | 17 | 2021-09-06T13:35:52.000Z | 2022-03-11T21:08:15.000Z | biotorch/models/backpropagation/__init__.py | jsalbert/biotorch | 74fad0dd32529e754e4bba8298d4e0fd0a06a886 | [
"Apache-2.0"
] | null | null | null | biotorch/models/backpropagation/__init__.py | jsalbert/biotorch | 74fad0dd32529e754e4bba8298d4e0fd0a06a886 | [
"Apache-2.0"
] | 1 | 2022-02-11T15:19:10.000Z | 2022-02-11T15:19:10.000Z | from .alexnet import *
from .densenet import *
from .le_net import *
from .resnet import *
| 18.2 | 23 | 0.736264 |
2fcdddfb43f913c1478c7ca5535d550f8cebdcb5 | 1,064 | py | Python | sherlockgcd.py | abhnvkmr/hackerRank | b1fd738f3e7aca5a9ea418d2e5801a698f3fffd6 | [
"MIT"
] | null | null | null | sherlockgcd.py | abhnvkmr/hackerRank | b1fd738f3e7aca5a9ea418d2e5801a698f3fffd6 | [
"MIT"
] | null | null | null | sherlockgcd.py | abhnvkmr/hackerRank | b1fd738f3e7aca5a9ea418d2e5801a698f3fffd6 | [
"MIT"
] | null | null | null | # Hackerrank - Algorithms - Warmup
# Sherlock and GCD
import math
def get_sieve(lim=10000):
x = [0 if not i % 2 else 1 for i in range(lim + 1)]
x[2] = 1
for i in range(3, math.ceil(math.sqrt(lim + 1)), 2):
for j in range(i + 1, lim + 1):
if not j % i:
x[j] = 0
retu... | 23.130435 | 67 | 0.489662 |
3de288d8c1cafab0c7fa0ef80b25207cad3146e5 | 8,469 | py | Python | examples/GAN/DiscoGAN-CelebA.py | Pearl-UTexas/tensorpack | 3ef33a341861769e66995e1630949113404cdd0c | [
"Apache-2.0"
] | 5 | 2018-05-04T02:04:15.000Z | 2020-04-02T05:38:48.000Z | examples/GAN/DiscoGAN-CelebA.py | Pearl-UTexas/tensorpack | 3ef33a341861769e66995e1630949113404cdd0c | [
"Apache-2.0"
] | null | null | null | examples/GAN/DiscoGAN-CelebA.py | Pearl-UTexas/tensorpack | 3ef33a341861769e66995e1630949113404cdd0c | [
"Apache-2.0"
] | 2 | 2018-04-23T13:43:10.000Z | 2019-10-30T09:56:54.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: DiscoGAN-CelebA.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
import os
import argparse
from six.moves import map, zip
import numpy as np
from tensorpack import *
from tensorpack.tfutils.summary import add_moving_summary
from tensorpack.tfutils.scope_utils import a... | 39.208333 | 110 | 0.601134 |
a857906d29504c1ef4d316987ebfb1a7ed22855e | 5,479 | py | Python | DatasetLoader.py | hdmjdp/voxceleb_trainer | 326a79ab7ef2dea13f06f1ed5aa5a31ad81c5c4c | [
"MIT"
] | null | null | null | DatasetLoader.py | hdmjdp/voxceleb_trainer | 326a79ab7ef2dea13f06f1ed5aa5a31ad81c5c4c | [
"MIT"
] | null | null | null | DatasetLoader.py | hdmjdp/voxceleb_trainer | 326a79ab7ef2dea13f06f1ed5aa5a31ad81c5c4c | [
"MIT"
] | null | null | null | #! /usr/bin/python
# -*- encoding: utf-8 -*-
import torch
import numpy
import random
import pdb
import os
import threading
import time
import math
import glob
from torch.utils.data import Dataset, DataLoader
import torch.distributed as dist
import cv2
import sklearn.preprocessing as preprocessing
import torch.utils as... | 31.308571 | 107 | 0.607958 |
6eaf036e3c52472637fb1ffd597f8b70af6fafc2 | 20,195 | py | Python | ncov_ism/_pickism.py | z2e2/ncov_ism | 14e3dcd7c568e21b437dfdb7d74353ed8bd93c8f | [
"BSD-3-Clause"
] | null | null | null | ncov_ism/_pickism.py | z2e2/ncov_ism | 14e3dcd7c568e21b437dfdb7d74353ed8bd93c8f | [
"BSD-3-Clause"
] | null | null | null | ncov_ism/_pickism.py | z2e2/ncov_ism | 14e3dcd7c568e21b437dfdb7d74353ed8bd93c8f | [
"BSD-3-Clause"
] | 1 | 2020-08-04T23:59:26.000Z | 2020-08-04T23:59:26.000Z | import logging
import json
import datetime
import pandas as pd
import numpy as np
from collections import Counter, OrderedDict
from math import log2, ceil
from Bio import SeqIO
logging.basicConfig(format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S', level=logging.INFO)
def base_entropy_masked(seq_list, ba... | 39.520548 | 193 | 0.594999 |
b34af42ce37a40382ac19834f10af0eeb5a25bf0 | 300 | py | Python | thundertac/pyu_cfg/client_config.py | diVineProportion/thundertac | bbff37432b88b3b29cf9ba275df0fe94e5b27b8b | [
"Apache-2.0"
] | 11 | 2020-01-02T20:48:05.000Z | 2022-01-04T21:59:12.000Z | thundertac/pyu_cfg/client_config.py | diVineProportion/thundertac | bbff37432b88b3b29cf9ba275df0fe94e5b27b8b | [
"Apache-2.0"
] | 5 | 2020-01-11T00:01:19.000Z | 2022-03-12T00:08:55.000Z | thundertac/pyu_cfg/client_config.py | diVineProportion/thundertac | bbff37432b88b3b29cf9ba275df0fe94e5b27b8b | [
"Apache-2.0"
] | 1 | 2020-09-02T20:09:44.000Z | 2020-09-02T20:09:44.000Z | class ClientConfig(object):
PUBLIC_KEY = '7fqG6ZDxHhGKxY+501J0J6MgAgnTdTcHSkvd78Ww740'
APP_NAME = 'ThunderTac'
COMPANY_NAME = 'ThunderApps'
HTTP_TIMEOUT = 30
MAX_DOWNLOAD_RETRIES = 3
UPDATE_URLS = ['https://raw.githubusercontent.com/diVineProportion/thundertacupdates/main/']
| 37.5 | 96 | 0.756667 |
cecd2faabcfe71004b081e8f1a17dd8df488974b | 4,672 | py | Python | do_babi_run.py | hexahedria/gated-graph-transformer-network | 1fd7df8b5629152a7afa9a2a8a67346d52bf0d94 | [
"MIT"
] | 160 | 2016-12-13T03:37:16.000Z | 2020-07-02T05:11:42.000Z | do_babi_run.py | danieldjohnson/gated-graph-transformer-network | 1fd7df8b5629152a7afa9a2a8a67346d52bf0d94 | [
"MIT"
] | 2 | 2017-05-09T05:31:14.000Z | 2017-05-09T23:18:28.000Z | do_babi_run.py | hexahedria/gated-graph-transformer-network | 1fd7df8b5629152a7afa9a2a8a67346d52bf0d94 | [
"MIT"
] | 20 | 2017-02-19T11:10:38.000Z | 2020-08-25T12:18:44.000Z | import run_harness
import argparse
import os
import shlex
def main(tasks_dir, output_dir, excluding=[], including_only=None, run_sequential_set=False, just_setup=False, stop_on_error=False, extra_args=[], dataset_sizes=None, direct_ref_enabled=None):
base_params = " ".join([
"20",
"--mutable-nodes"... | 48.666667 | 192 | 0.615154 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.