hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3898818cffa7348277055bf10d0fa706b8f02913 | 2,412 | py | Python | jax/abstract_arrays.py | akihironitta/jax | c67454d0f85dd786b09ba2944bb629f3c88302f2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/abstract_arrays.py | akihironitta/jax | c67454d0f85dd786b09ba2944bb629f3c88302f2 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-01T05:38:44.000Z | 2020-10-01T05:38:44.000Z | jax/abstract_arrays.py | rahul-deepsource/jax | 24c02148f27345b35555b0898bfc1d694a68c19a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-09-16T11:34:14.000Z | 2020-09-16T11:34:14.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.16 | 74 | 0.766584 |
389884d7b5c340a0e7dd5ce53dd450d10cfdf853 | 31,720 | py | Python | openmdao/core/tests/test_discrete.py | tong0711/OpenMDAO | d8496a0e606df405b2472f1c96b3c543eacaca5a | [
"Apache-2.0"
] | null | null | null | openmdao/core/tests/test_discrete.py | tong0711/OpenMDAO | d8496a0e606df405b2472f1c96b3c543eacaca5a | [
"Apache-2.0"
] | null | null | null | openmdao/core/tests/test_discrete.py | tong0711/OpenMDAO | d8496a0e606df405b2472f1c96b3c543eacaca5a | [
"Apache-2.0"
] | null | null | null | """ Unit tests for discrete variables."""
import sys
import unittest
import copy
from io import StringIO
import numpy as np
import openmdao.api as om
from openmdao.core.driver import Driver
from openmdao.visualization.n2_viewer.n2_viewer import _get_viewer_data
from openmdao.test_suite.components.sellar import State... | 32.904564 | 132 | 0.579256 |
38988bf2491090d1412f11767f2f6a138eb9e256 | 1,619 | py | Python | tf_agents/agents/ppo/examples/train_eval_atari.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | 2 | 2018-12-20T01:49:33.000Z | 2019-12-09T13:17:05.000Z | tf_agents/agents/ppo/examples/train_eval_atari.py | kuanfang/agents | a0f25a4b44d4fc844c9b804bab60af2167f8d2bb | [
"Apache-2.0"
] | null | null | null | tf_agents/agents/ppo/examples/train_eval_atari.py | kuanfang/agents | a0f25a4b44d4fc844c9b804bab60af2167f8d2bb | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 30.54717 | 74 | 0.779494 |
38988fd15daad576ae0e8f2f49ca7213eeae0b75 | 452 | py | Python | Glyph Making/EmptyLayers.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | 2 | 2021-02-12T20:36:29.000Z | 2021-11-03T08:04:01.000Z | Glyph Making/EmptyLayers.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | Glyph Making/EmptyLayers.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | # MenuTitle: Empty All layers for Selected
# Author: Ben Jones
__doc__ = """
Deletes all anchors, outlines and components for the selected glyph
"""
Font = Glyphs.currentDocument.font
def doit():
for g in [x.parent for x in Glyphs.font.selectedLayers]:
for l in g.layers:
l.paths = []
... | 20.545455 | 67 | 0.654867 |
3898b69f9e700ea6789a5f2e2ee61c8a551ec901 | 10,990 | py | Python | tests/test_utils/perf/scheduler_dag_execution_timing.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 1 | 2021-03-03T07:00:02.000Z | 2021-03-03T07:00:02.000Z | tests/test_utils/perf/scheduler_dag_execution_timing.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 36 | 2021-11-26T00:08:49.000Z | 2021-11-26T00:09:33.000Z | tests/test_utils/perf/scheduler_dag_execution_timing.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 3 | 2020-06-30T02:38:17.000Z | 2022-01-19T06:14:08.000Z | #!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | 33.506098 | 109 | 0.65505 |
3898c4ae53aa659e791bee88881baedc6d80049b | 39,073 | py | Python | external/sbml/bindings/python/test/sbml/TestAncestor.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | 1 | 2019-08-22T17:17:41.000Z | 2019-08-22T17:17:41.000Z | external/sbml/bindings/python/test/sbml/TestAncestor.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | external/sbml/bindings/python/test/sbml/TestAncestor.py | dchandran/evolvenetworks | 072f9e1292552f691a86457ffd16a5743724fb5e | [
"BSD-3-Clause"
] | null | null | null | #
# @file TestAncestor.py
# @brief SBML ancestor objects unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# $Id: TestAncestor.py 10124 2009-08-28 12:04:51Z sarahkeating $
# $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings/python/test/sbml/TestA... | 43.951631 | 119 | 0.712999 |
3898cab76ae5876459cd4899c54cafa14234971d | 5,190 | py | Python | facexlib/parsing/bisenet.py | spy14414/facexlib | 6be8bdcfe32198374c17588132a72022ad88ae3b | [
"MIT"
] | 164 | 2021-05-15T20:15:42.000Z | 2022-03-25T19:39:24.000Z | facexlib/parsing/bisenet.py | spy14414/facexlib | 6be8bdcfe32198374c17588132a72022ad88ae3b | [
"MIT"
] | 7 | 2021-08-03T15:56:49.000Z | 2022-02-24T13:50:33.000Z | facexlib/parsing/bisenet.py | daobook/facexlib | e5768d1722a3fddc6ccd1b91a6a17f432ed149b4 | [
"MIT"
] | 32 | 2021-05-16T03:10:24.000Z | 2022-03-19T12:02:00.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from .resnet import ResNet18
class ConvBNReLU(nn.Module):
def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1):
super(ConvBNReLU, self).__init__()
self.conv = nn.Conv2d(in_chan, out_chan, kernel_size=ks, stride=stride... | 36.808511 | 108 | 0.632948 |
3898fcbda8aa761699c212ad7d4670f25ede3656 | 8,270 | py | Python | components/collector/src/source_collectors/__init__.py | ICTU/quality-time | 88d80ea30e35bd5f0bf5cce7cb43dc9f439e91f5 | [
"Apache-2.0"
] | 33 | 2016-01-20T07:35:48.000Z | 2022-03-14T09:20:51.000Z | components/collector/src/source_collectors/__init__.py | ICTU/quality-time | 88d80ea30e35bd5f0bf5cce7cb43dc9f439e91f5 | [
"Apache-2.0"
] | 2,410 | 2016-01-22T18:13:01.000Z | 2022-03-31T16:57:34.000Z | components/collector/src/source_collectors/__init__.py | ICTU/quality-time | 88d80ea30e35bd5f0bf5cce7cb43dc9f439e91f5 | [
"Apache-2.0"
] | 21 | 2016-01-16T11:49:23.000Z | 2022-01-14T21:53:22.000Z | """Source collectors."""
from .anchore.security_warnings import AnchoreSecurityWarnings
from .anchore.source_up_to_dateness import AnchoreSourceUpToDateness
from .anchore_jenkins_plugin.security_warnings import AnchoreJenkinsPluginSecurityWarnings
from .anchore_jenkins_plugin.source_up_to_dateness import AnchoreJenki... | 49.520958 | 111 | 0.903386 |
38990a5de8ddc8ab8756a257e26277b003d714c6 | 2,778 | py | Python | tests/cherrypyrequest.py | Noneus/slojsonrpc | 33b5d79486e1562fe4fc7b73b8f3014535168b03 | [
"MIT"
] | null | null | null | tests/cherrypyrequest.py | Noneus/slojsonrpc | 33b5d79486e1562fe4fc7b73b8f3014535168b03 | [
"MIT"
] | null | null | null | tests/cherrypyrequest.py | Noneus/slojsonrpc | 33b5d79486e1562fe4fc7b73b8f3014535168b03 | [
"MIT"
] | null | null | null | '''
The MIT License (MIT)
Copyright (c) 2014 Stefan Lohmaier
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, mer... | 39.126761 | 80 | 0.615191 |
389944e18f8a5e17157470b7b2ff5977c7336a46 | 8,236 | py | Python | PythonProjects/04-TheAccumulatorPattern/src/m3_graphical_accumulating.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/04-TheAccumulatorPattern/src/m3_graphical_accumulating.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/04-TheAccumulatorPattern/src/m3_graphical_accumulating.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | """
This module lets you practice one form of the ACCUMULATOR pattern,
namely, the "IN GRAPHICS" form which features:
-- DRAWING OBJECTS via ACCUMULATING positions and/or sizes,
as in: x = x + pixels
Additionally, it emphasizes that you must
** DO A CONCRETE EXAMPLE BY HAND **
before you can implement a sol... | 36.932735 | 79 | 0.501821 |
38994754614cbb56d2b46541d6f61fc106c459d8 | 763 | py | Python | alipay/aop/api/response/AlipayEbppInvoiceExpenserulesProjectrulesModifyResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayEbppInvoiceExpenserulesProjectrulesModifyResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayEbppInvoiceExpenserulesProjectrulesModifyResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayEbppInvoiceExpenserulesProjectrulesModifyResponse(AlipayResponse):
def __init__(self):
super(AlipayEbppInvoiceExpenserulesProjectrulesModifyResponse, self).__init__()
... | 29.346154 | 128 | 0.732634 |
38996462944e72802de8fc7bf67a4e9f457fe6dd | 1,850 | py | Python | api/utils.py | hack4impact-uiuc/nnb-backend-v2 | 05babff223eaad95c6cf47dddc0e30b894af9830 | [
"MIT"
] | 1 | 2018-03-07T17:40:10.000Z | 2018-03-07T17:40:10.000Z | api/utils.py | hack4impact-uiuc/nnb-backend-v2 | 05babff223eaad95c6cf47dddc0e30b894af9830 | [
"MIT"
] | 29 | 2018-02-23T10:06:58.000Z | 2018-04-29T09:44:52.000Z | api/utils.py | hack4impact-uiuc/nnb-backend-v2 | 05babff223eaad95c6cf47dddc0e30b894af9830 | [
"MIT"
] | null | null | null | import json
from flask import jsonify
def create_response(data={}, status=200, message=''):
"""
Wraps response in a consistent format throughout the API
Format inspired by https://medium.com/@shazow/how-i-design-json-api-responses-71900f00f2db
Modifications included:
- make success a boolean since ... | 33.035714 | 95 | 0.652432 |
38996877d74ac108ada0d0ca7619f53e0a629842 | 1,055 | py | Python | sonnet/optimizers.py | chentingpc/sonnet | adae0b2e1700037bab289437f778ec4192b9881e | [
"Apache-2.0"
] | 1 | 2021-05-03T20:22:20.000Z | 2021-05-03T20:22:20.000Z | sonnet/optimizers.py | chentingpc/sonnet | adae0b2e1700037bab289437f778ec4192b9881e | [
"Apache-2.0"
] | null | null | null | sonnet/optimizers.py | chentingpc/sonnet | adae0b2e1700037bab289437f778ec4192b9881e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Sonnet 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... | 32.96875 | 78 | 0.704265 |
38997eb2ec9bb71ec0537b307f7e6f537eddfb6f | 866 | py | Python | allopath/cmap_utils.py | pablo-arantes/allosteric-pathways | 51b632abd029ab5be8aa5ef11737ff603cff9315 | [
"MIT"
] | 6 | 2020-12-12T22:39:50.000Z | 2022-03-25T19:38:39.000Z | allopath/cmap_utils.py | pablo-arantes/allosteric-pathways | 51b632abd029ab5be8aa5ef11737ff603cff9315 | [
"MIT"
] | 2 | 2021-06-22T01:54:35.000Z | 2021-09-10T09:50:46.000Z | allopath/cmap_utils.py | delemottelab/allosteric-pathways | 51b632abd029ab5be8aa5ef11737ff603cff9315 | [
"MIT"
] | 1 | 2021-03-19T17:24:41.000Z | 2021-03-19T17:24:41.000Z | import numpy as np
import mdtraj as md
def get_atom_pairs(inds1, inds2):
# Construct array with all pairs
atom_pairs = np.zeros((len(inds1)*len(inds2),2))
counter = 0
for k in range(0,len(inds1)):
for l in range(0,len(inds2)):
atom_pairs[counter,0] = inds1[k]
atom_pairs[counter,1] = inds2[l]
counter += ... | 28.866667 | 91 | 0.711316 |
3899bba3225d5a3753a0937ac8a7a629a3b8dabb | 538 | py | Python | problems/121_best-time-to-buy-and-sell-stock.py | okuda-seminar/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | null | null | null | problems/121_best-time-to-buy-and-sell-stock.py | okuda-seminar/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | 170 | 2021-05-11T14:03:05.000Z | 2021-11-30T14:22:52.000Z | problems/121_best-time-to-buy-and-sell-stock.py | ryuji0123/review_leetcode | 9774dbb85b836c3ebab4b24d77774ed05abb7a32 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=121 lang=python3
#
# [121] Best Time to Buy and Sell Stock
#
# @lc code=start
class Solution:
def maxProfit(self, prices: List[int]) -> int:
"""
time: O(len(prices))
space: O(len(prices))
"""
if not prices:
return ""
min_price = p... | 20.692308 | 59 | 0.539033 |
3899c8e0f004c9479e5ef17aedf0cfbcafb5799c | 1,445 | py | Python | modules.py | jinyeom/ppo | c224609c6b6e9623f25bd3415d79bfc7b92f184e | [
"MIT"
] | 1 | 2019-10-25T02:32:11.000Z | 2019-10-25T02:32:11.000Z | modules.py | jinyeom/ppo | c224609c6b6e9623f25bd3415d79bfc7b92f184e | [
"MIT"
] | null | null | null | modules.py | jinyeom/ppo | c224609c6b6e9623f25bd3415d79bfc7b92f184e | [
"MIT"
] | null | null | null | import torch as pt
from torch import nn
from torch.nn import init
from torch.nn import functional as F
class DeepMindAtari(nn.Module):
def __init__(self, hid_dim):
super().__init__()
self.conv1 = nn.Conv2d(3, 32, 8, stride=4)
self.conv2 = nn.Conv2d(32, 64, 4, stride=2)
self.conv3 = nn.Conv2d(64, 32, ... | 28.9 | 73 | 0.656747 |
3899de7e51312f6e7667205028c63b3988642553 | 2,314 | py | Python | installer/core/commands/destroy.py | Diffblue-benchmarks/pacbot | 4709eb11f87636bc42a52e7a76b740f9d76d156d | [
"Apache-2.0"
] | 1 | 2019-09-18T13:04:08.000Z | 2019-09-18T13:04:08.000Z | installer/core/commands/destroy.py | Diffblue-benchmarks/pacbot | 4709eb11f87636bc42a52e7a76b740f9d76d156d | [
"Apache-2.0"
] | 38 | 2020-03-04T23:28:22.000Z | 2021-12-14T21:33:30.000Z | installer/core/commands/destroy.py | Diffblue-benchmarks/pacbot | 4709eb11f87636bc42a52e7a76b740f9d76d156d | [
"Apache-2.0"
] | 1 | 2020-01-14T09:10:10.000Z | 2020-01-14T09:10:10.000Z | from core.commands import BaseCommand
from core import constants as K
import importlib
class Destroy(BaseCommand):
"""
Base install class which identify actual provide destroy class and execute destruction
Attributes:
terraform_with_targets (Boolean): Identify whether complete installation or par... | 37.322581 | 116 | 0.651253 |
3899f761b76cd9ef437769273f77f906ada61833 | 4,623 | py | Python | utils/checkpoint.py | Howe-Young/asc_triplet | 12a018e6fd14c61ffedc87c8609b128e28c51d8d | [
"MIT"
] | 7 | 2019-01-08T11:02:50.000Z | 2021-01-12T14:16:51.000Z | utils/checkpoint.py | Howe-Young/asc_triplet | 12a018e6fd14c61ffedc87c8609b128e28c51d8d | [
"MIT"
] | 4 | 2019-01-08T12:47:58.000Z | 2019-01-09T12:18:54.000Z | utils/checkpoint.py | Howe-Young/asc_triplet | 12a018e6fd14c61ffedc87c8609b128e28c51d8d | [
"MIT"
] | 6 | 2019-01-04T14:13:47.000Z | 2020-06-17T07:48:17.000Z | import torch
import os
import numpy as np
np.random.seed(0)
class CheckPoint(object):
"""
Bind model and optimizer
"""
def __init__(self, model=None, optimizer=None, path=None, prefix="", interval=5, save_num=3, verbose=True):
self.verbose = verbose
self.model = model
self.opt... | 38.525 | 128 | 0.565217 |
3899ffb21ae232293a43438dfdbad604b10e5e85 | 99,438 | py | Python | altair/vegalite/v5/api.py | ChristopherDavisUCI/altair | 454bbfe61c030c54725156013320b131fa3597d5 | [
"BSD-3-Clause"
] | null | null | null | altair/vegalite/v5/api.py | ChristopherDavisUCI/altair | 454bbfe61c030c54725156013320b131fa3597d5 | [
"BSD-3-Clause"
] | null | null | null | altair/vegalite/v5/api.py | ChristopherDavisUCI/altair | 454bbfe61c030c54725156013320b131fa3597d5 | [
"BSD-3-Clause"
] | 1 | 2021-11-09T20:31:23.000Z | 2021-11-09T20:31:23.000Z | import warnings
import hashlib
import io
import json
import jsonschema
import pandas as pd
from toolz.curried import pipe as _pipe
from .schema import core, channels, mixins, Undefined, SCHEMA_URL
from .data import data_transformers
from ... import utils, expr
from .display import renderers, VEGALITE_VERSION, VEGAEM... | 35.249202 | 100 | 0.591193 |
389a1348e402b2621ceb7ab02f97a704bb3fb5be | 16,176 | py | Python | research/deeplab/utils/train_utils.py | chrisfilippis/models | df98ff0011a009694e72000b12c9ee4b21d7b659 | [
"Apache-2.0"
] | null | null | null | research/deeplab/utils/train_utils.py | chrisfilippis/models | df98ff0011a009694e72000b12c9ee4b21d7b659 | [
"Apache-2.0"
] | null | null | null | research/deeplab/utils/train_utils.py | chrisfilippis/models | df98ff0011a009694e72000b12c9ee4b21d7b659 | [
"Apache-2.0"
] | 2 | 2021-02-17T06:59:57.000Z | 2021-03-18T10:12:30.000Z | # Lint as: python2, python3
# Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 43.367292 | 80 | 0.679896 |
389a45913b44aa1d313e5d993e1ff70d1cff1def | 3,560 | py | Python | snippets/yelp_1_convert_json_to_csv_python2.py | cjneetha/osm | cc391fbfee8c89a1f15257ea36e6bbc85bbea938 | [
"MIT"
] | null | null | null | snippets/yelp_1_convert_json_to_csv_python2.py | cjneetha/osm | cc391fbfee8c89a1f15257ea36e6bbc85bbea938 | [
"MIT"
] | null | null | null | snippets/yelp_1_convert_json_to_csv_python2.py | cjneetha/osm | cc391fbfee8c89a1f15257ea36e6bbc85bbea938 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Convert the Yelp Dataset Challenge dataset from json format to csv.
For more information on the Yelp Dataset Challenge please visit http://yelp.com/dataset_challenge
"""
import collections
import csv
import json
def read_and_write_file(json_file_path, csv_file_path, column_names):
"""... | 27.384615 | 99 | 0.595506 |
389a8a9911a8bef300c2ff6d9103d7e60673f067 | 2,379 | py | Python | tests/core/test_bbox.py | XavierCLL/gis4wrf | 686b167d656f5f1835858f1b94de4423091f957c | [
"MIT"
] | 111 | 2018-06-13T15:34:52.000Z | 2022-03-23T04:59:53.000Z | tests/core/test_bbox.py | mostamndi/gis4wrf | 93eb69e5f2e87e9805dcaf8fee05db0228fd81c4 | [
"MIT"
] | 190 | 2018-06-14T15:08:37.000Z | 2022-03-02T14:02:54.000Z | tests/core/test_bbox.py | mostamndi/gis4wrf | 93eb69e5f2e87e9805dcaf8fee05db0228fd81c4 | [
"MIT"
] | 29 | 2018-06-13T15:35:05.000Z | 2022-01-27T03:18:18.000Z | # GIS4WRF (https://doi.org/10.5281/zenodo.1288569)
# Copyright (c) 2018 D. Meyer and M. Riechert. Licensed under MIT.
from gis4wrf.core.project import (
get_bbox_from_grid_spec, get_parent_bbox_from_child_grid_spec,
get_bbox_center, Project
)
from gis4wrf.core import BoundingBox2D
def test_innermost_domain_bb... | 33.985714 | 105 | 0.617907 |
389a8fd07f30925981b40b7399e8ad46d9170c0c | 523 | py | Python | CHAPTER 04 (recursion)/english_ruler.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 04 (recursion)/english_ruler.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 04 (recursion)/english_ruler.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | # English ruler
def draw_line(tick_length, tick_label = ""):
line = "-" * tick_length
if tick_label:
line += " " + tick_label
print(line)
def draw_interval(center_length):
if center_length > 0:
draw_interval(center_length-1)
draw_line(center_length)
draw_interval(cente... | 26.15 | 44 | 0.665392 |
389a9a27af05e997105ea2a6a2d8b80502ed8e5e | 3,381 | py | Python | ria/GreyMatter/utils.py | sjsucohort6/amigo-chatbot | ca4be6e0b90cd581b34f7414159dfc6a50eca969 | [
"MIT"
] | 5 | 2017-06-16T00:23:31.000Z | 2019-10-15T14:20:56.000Z | ria/GreyMatter/utils.py | sjsucohort6/amigo-chatbot | ca4be6e0b90cd581b34f7414159dfc6a50eca969 | [
"MIT"
] | null | null | null | ria/GreyMatter/utils.py | sjsucohort6/amigo-chatbot | ca4be6e0b90cd581b34f7414159dfc6a50eca969 | [
"MIT"
] | 3 | 2017-10-01T18:11:42.000Z | 2019-03-28T06:14:07.000Z | import re
import json
import pprint
import requests
from requests.auth import HTTPBasicAuth
"""
Global Constants
"""
HTTPS = 'false'
USER = 'watsh.rajneesh@sjsu.edu'
PASSWORD='pass'
def clean_msg(wiki_data):
regEx = re.compile(r'([^\(]*)\([^\)]*\) *(.*)')
m = regEx.match(wiki_data)
while m:
wiki_d... | 26.414063 | 118 | 0.619048 |
389a9fc0c3c196927fb30efef8084e7b69495b59 | 33,918 | py | Python | VECO/NLU/third_party/run_classify.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | 1 | 2022-03-01T02:30:32.000Z | 2022-03-01T02:30:32.000Z | VECO/NLU/third_party/run_classify.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | null | null | null | VECO/NLU/third_party/run_classify.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | 1 | 2021-07-10T09:50:47.000Z | 2021-07-10T09:50:47.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors,
# The HuggingFace Inc. team, The XTREME Benchmark Authors and Alibaba inc.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | 42.344569 | 182 | 0.691757 |
389ab0d00181f79ab77d1033760d34ef1c36773e | 978 | py | Python | slurmified/helpers.py | slavoutich/slurmified | a96cdd936a12864cec880f82876fd8fed6e0e06e | [
"BSD-2-Clause"
] | 4 | 2017-03-09T18:42:06.000Z | 2018-07-19T15:29:43.000Z | slurmified/helpers.py | slavoutich/slurmified | a96cdd936a12864cec880f82876fd8fed6e0e06e | [
"BSD-2-Clause"
] | null | null | null | slurmified/helpers.py | slavoutich/slurmified | a96cdd936a12864cec880f82876fd8fed6e0e06e | [
"BSD-2-Clause"
] | null | null | null | from .core import Cluster
from distributed import Client, progress
def map_interactive(n_workers, **kwargs):
"""Generates a map function `map_func(func, arg_list)`, that executes
function `func` over argument list `arg_list`, creating temporary
Dask.distributed cluster.
Parameters
----------
... | 32.6 | 77 | 0.648262 |
389ad44367abcd1b858b6992bf98c32628cb0615 | 759 | py | Python | tests/test_provider_transloadit_transloadit.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | tests/test_provider_transloadit_transloadit.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | tests/test_provider_transloadit_transloadit.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # tests/test_provider_transloadit_transloadit.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:29:09 UTC)
def test_provider_import():
import terrascript.provider.transloadit.transloadit
def test_resource_import():
from terrascript.resource.transloadit.transloadit import transloadit_template... | 30.36 | 82 | 0.765481 |
389b1f90d14f748bca65f5c75a2bcc8b658dd3cc | 6,390 | py | Python | tests/unit/utils/verify_test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2015-10-06T22:25:22.000Z | 2015-10-06T22:25:22.000Z | tests/unit/utils/verify_test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/verify_test.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2020-12-04T11:28:06.000Z | 2020-12-04T11:28:06.000Z | '''
Test the verification routines
'''
# Import Python libs
import getpass
import os
import sys
import stat
import shutil
import resource
import tempfile
# Import Salt libs
import salt.utils
from saltunittest import skipIf, TestCase, TestsLoggingHandler
from salt.utils.verify import (
check_user,
verify_env,... | 35.10989 | 79 | 0.506416 |
389b5ce150de2dc8df29e7c8d91c513d03652898 | 62,687 | py | Python | docker/dockerfile/xiaofish/XiaoFish.py | mytliulei/boundless | e2c756e80f838cdb49914a5967a2a9a30a04664f | [
"Apache-2.0"
] | 9 | 2015-02-10T08:22:00.000Z | 2021-07-05T15:12:41.000Z | docker/dockerfile/xfdsend/XiaoFish.py | mytliulei/boundless | e2c756e80f838cdb49914a5967a2a9a30a04664f | [
"Apache-2.0"
] | null | null | null | docker/dockerfile/xfdsend/XiaoFish.py | mytliulei/boundless | e2c756e80f838cdb49914a5967a2a9a30a04664f | [
"Apache-2.0"
] | 6 | 2016-04-06T09:26:43.000Z | 2021-06-15T04:47:47.000Z | #!/usr/bin/env python
#-*- coding: UTF-8 -*-
'''network stream genertor,for RF testing base on XMLRPC and scapy
ps: XiaoFish is a little cat, bless her. :)
'''
import os,os.path
import sys
import StringIO
import threading
import select
import time
import traceback
import re,binascii
import socket
import struct
fr... | 35.059843 | 168 | 0.529312 |
389b85082864504fe61c8472a136ee13be9154cc | 6,299 | py | Python | seymour/feeds/views.py | lerouxb/seymour | 124a93da67b6d6757b738469673232739ff0a4dc | [
"MIT"
] | null | null | null | seymour/feeds/views.py | lerouxb/seymour | 124a93da67b6d6757b738469673232739ff0a4dc | [
"MIT"
] | null | null | null | seymour/feeds/views.py | lerouxb/seymour | 124a93da67b6d6757b738469673232739ff0a4dc | [
"MIT"
] | null | null | null | import feedfinder
import feedparser
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect, Http404, HttpResponse
from seymour.feeds.models import Feed, Item, AccountFeed
from seymour.feeds.forms import SelectFeedForm, ManageFeedsForm, Ed... | 34.60989 | 107 | 0.548817 |
389b959fa435421f08dcdd44690a6d4bbebd2761 | 309 | py | Python | (1)Text/textwrap_fill_width.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | (1)Text/textwrap_fill_width.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | (1)Text/textwrap_fill_width.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | import textwrap
from textwrap_example import sample_text
#dedented text can be passed through fill() with a few values
dedented_text = textwrap.dedent(sample_text).strip()
for width in [45, 60]:
print('{} Columns:\n'.format(width))
print(textwrap.fill(dedented_text , width = width ))
print()
| 25.75 | 62 | 0.728155 |
389bb7996e87b2813a7704ef5e0c14332f95ab08 | 1,534 | py | Python | fluid/image_classification/caffe2fluid/kaffe/custom_layers/axpy.py | wojtuss/models | 5d1dc2ff7d3355984c469f0906d24447b58a5ffe | [
"Apache-2.0"
] | null | null | null | fluid/image_classification/caffe2fluid/kaffe/custom_layers/axpy.py | wojtuss/models | 5d1dc2ff7d3355984c469f0906d24447b58a5ffe | [
"Apache-2.0"
] | null | null | null | fluid/image_classification/caffe2fluid/kaffe/custom_layers/axpy.py | wojtuss/models | 5d1dc2ff7d3355984c469f0906d24447b58a5ffe | [
"Apache-2.0"
] | null | null | null | """ A custom layer for 'axpy' which receives 3 tensors and output 1 tensor.
the function performed is:(the mupltiplication and add are elementewise)
output = inputs[0] * inputs[1] + inputs[2]
"""
from .register import register
def axpy_shape(input_shapes):
""" calculate the output shape of this layer... | 29.5 | 81 | 0.657757 |
389bd483cef1e5bbc3eedcea9532d5da4e86ba1a | 12,836 | py | Python | dags/monthly_budget_mover_dag.py | danieldjewell/starthinker | 3327d5874f01d7563603b8a82c1ecd6615b9768d | [
"Apache-2.0"
] | 1 | 2020-12-04T17:13:35.000Z | 2020-12-04T17:13:35.000Z | dags/monthly_budget_mover_dag.py | hgrias/starthinker | b9ed33e23b4ffd72565a31ebb8a8041d346bfca2 | [
"Apache-2.0"
] | null | null | null | dags/monthly_budget_mover_dag.py | hgrias/starthinker | b9ed33e23b4ffd72565a31ebb8a8041d346bfca2 | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 32.496203 | 244 | 0.481926 |
389bea01fdb3022ebfb27cf752f1f7e226bef434 | 25,163 | py | Python | leo/plugins/babel_lib.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/babel_lib.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | leo/plugins/babel_lib.py | frakel/leo-editor | b574118ee3b7ffe8344fa0d00dac603096117ac7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#coding=utf-8
#@+leo-ver=5-thin
#@+node:bob.20170726143458.1: * @file babel_lib.py
#@@first
#@@first
#@@language python
#@@tabwidth -4
#@+<< documentation >>
#@+node:bob.20170726143458.2: ** << documentation >>
"""
The scheme for real-time streaming of stdout and stderr while the script is still exec... | 34.469863 | 114 | 0.590669 |
389c12537a6bf1a2c8b60fda86d8e36f5547cb08 | 2,525 | py | Python | ufora/FORA/python/PurePython/ModuleTestCases.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | ufora/FORA/python/PurePython/ModuleTestCases.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | ufora/FORA/python/PurePython/ModuleTestCases.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | # Copyright 2015 Ufora 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 i... | 36.071429 | 89 | 0.738614 |
389c22acc59c0f1af179370bf47494246ca5bb85 | 1,298 | py | Python | paranuara_challenge/dao/company_dao.py | sapangupta15/paranuara_planet | e71d17216495160cfe22e8e94cbd72e2d99ced40 | [
"Apache-2.0"
] | null | null | null | paranuara_challenge/dao/company_dao.py | sapangupta15/paranuara_planet | e71d17216495160cfe22e8e94cbd72e2d99ced40 | [
"Apache-2.0"
] | null | null | null | paranuara_challenge/dao/company_dao.py | sapangupta15/paranuara_planet | e71d17216495160cfe22e8e94cbd72e2d99ced40 | [
"Apache-2.0"
] | null | null | null | import os
import json
from sqlalchemy import func
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound
from paranuara_challenge.dao import resource_path
from paranuara_challenge.models.db.company import Company
from paranuara_challenge.services.db.session_manager import session_manager
from paranuara_chal... | 43.266667 | 111 | 0.781972 |
389c2a48646d44f9d9662b335d0cdb21fbcb7989 | 3,442 | py | Python | custodian/nwchem/handlers.py | acrutt/custodian | 4d7cfecef0957bc8c2a6ec0cd24dd5855a6e7408 | [
"MIT"
] | null | null | null | custodian/nwchem/handlers.py | acrutt/custodian | 4d7cfecef0957bc8c2a6ec0cd24dd5855a6e7408 | [
"MIT"
] | null | null | null | custodian/nwchem/handlers.py | acrutt/custodian | 4d7cfecef0957bc8c2a6ec0cd24dd5855a6e7408 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals, division
"""
This module implements error handlers for Nwchem runs. Currently tested only
for B3LYP DFT jobs.
"""
__author__ = "Shyue Ping Ong"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "ongsp@ucsd.edu"
__status__ = "Beta"
__date__ = "5... | 34.42 | 79 | 0.55491 |
389c378771c0bd63c79fe2bb9103273bea5452f3 | 13,470 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dmac_training.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dmac_training.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/tests/test_dmac_training.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import uuid
import pytest
import functools
from devtools_testutils import recorded_by_proxy, set_bodiless_matcher, set_custom_default_matcher
from azure.... | 48.27957 | 133 | 0.719599 |
389c68a57f6103f470d767538f8232b4c15f4ee6 | 31,318 | py | Python | fsspec/spec.py | AlbertDeFusco/filesystem_spec | 3622478474fb71eede3f652b027996b87806e727 | [
"BSD-3-Clause"
] | null | null | null | fsspec/spec.py | AlbertDeFusco/filesystem_spec | 3622478474fb71eede3f652b027996b87806e727 | [
"BSD-3-Clause"
] | null | null | null | fsspec/spec.py | AlbertDeFusco/filesystem_spec | 3622478474fb71eede3f652b027996b87806e727 | [
"BSD-3-Clause"
] | null | null | null | from hashlib import md5
import io
from .utils import read_block, tokenize
# alternative names for some methods, which get patched to new instances
aliases = [
('makedir', 'mkdir'),
('listdir', 'ls'),
('cp', 'copy'),
('move', 'mv'),
('stat', 'info'),
('disk_usage', 'du'),
('rename', 'mv'),
... | 32.725183 | 87 | 0.545597 |
389c90605227a5acbfe9fc5ff6ef92f69781095a | 43 | py | Python | baselines/normCo/setup.py | meghbhalerao/graph-prompt | c6b54d6ef314c9f508c79943605debfb85901001 | [
"MIT"
] | null | null | null | baselines/normCo/setup.py | meghbhalerao/graph-prompt | c6b54d6ef314c9f508c79943605debfb85901001 | [
"MIT"
] | null | null | null | baselines/normCo/setup.py | meghbhalerao/graph-prompt | c6b54d6ef314c9f508c79943605debfb85901001 | [
"MIT"
] | null | null | null | import nltk
nltk.download("stopwords",".")
| 14.333333 | 30 | 0.72093 |
389ca7a9560033a3752ad8d2bc3d8cbd7e0c9175 | 1,612 | py | Python | src/lib/Bcfg2/Server/Plugins/Base.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Server/Plugins/Base.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Server/Plugins/Base.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | """This module sets up a base list of configuration entries."""
import copy
import lxml.etree
import sys
# py3k compatibility
if sys.hexversion >= 0x03000000:
from functools import reduce
import Bcfg2.Server.Plugin
class Base(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Server.Plugin.Structure,
Bcfg2... | 36.636364 | 74 | 0.60732 |
389ccd29a44f87a5669a486db5742bc5df181276 | 3,923 | py | Python | delfin/drivers/utils/rest_client.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | delfin/drivers/utils/rest_client.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | 1 | 2020-11-25T08:51:18.000Z | 2020-11-25T08:51:18.000Z | delfin/drivers/utils/rest_client.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SODA Authors.
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.ap... | 36.663551 | 78 | 0.601835 |
389d0c5571ab2f6ad2f6b19e3f4b166a880161cc | 2,254 | py | Python | osscla/scripts/utils.py | dschaller/osscla | b1ff167d65548e13ccf89babc9fbba21c70458c1 | [
"Apache-2.0"
] | 6 | 2017-12-07T06:43:52.000Z | 2021-09-03T19:15:29.000Z | osscla/scripts/utils.py | dschaller/osscla | b1ff167d65548e13ccf89babc9fbba21c70458c1 | [
"Apache-2.0"
] | 21 | 2017-08-07T20:03:40.000Z | 2022-01-09T01:39:47.000Z | osscla/scripts/utils.py | dschaller/osscla | b1ff167d65548e13ccf89babc9fbba21c70458c1 | [
"Apache-2.0"
] | 5 | 2017-08-05T05:14:08.000Z | 2020-11-27T10:44:52.000Z | from __future__ import absolute_import
from __future__ import print_function
import json
import dateutil.parser
from flask_script import Command, Option
import osscla.services
from osscla.app import app
from osscla.models.signatures import Signature
import six
class CreateSQSQueue(Command):
def run(self):
... | 31.305556 | 80 | 0.589618 |
389d0d2c00bc6b1421b74029cfa16f638ca4fa8d | 687 | py | Python | ksksite/article/models.py | Ki-Seki/ki-seki.site | efef59ee52a0b69501385c06ef6e4265f39d1738 | [
"MIT"
] | null | null | null | ksksite/article/models.py | Ki-Seki/ki-seki.site | efef59ee52a0b69501385c06ef6e4265f39d1738 | [
"MIT"
] | null | null | null | ksksite/article/models.py | Ki-Seki/ki-seki.site | efef59ee52a0b69501385c06ef6e4265f39d1738 | [
"MIT"
] | null | null | null | import uuid
from django.db import models
class Article(models.Model):
title = models.CharField(max_length=500, unique=True)
author = models.CharField(max_length=100, null=True, blank=True)
summary = models.TextField(null=True, blank=True)
created_at = models.DateTimeField()
modified_at = models.D... | 24.535714 | 92 | 0.700146 |
389d115c0500f62ca4301f536c6df3e1e921f957 | 1,881 | py | Python | lengthOfLIS.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | 1 | 2019-08-29T01:12:47.000Z | 2019-08-29T01:12:47.000Z | lengthOfLIS.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | lengthOfLIS.py | passionzhan/LeetCode | c4d33b64b9da15ca7a9b0d41e645d86a697694fe | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
@project : LeetCode
@File : lengthOfLIS.py
@Contact : 9824373@qq.com
@Desc :
给定一个无序的整数数组,找到其中最长上升子序列的长度。
示例:
输入: [10,9,2,5,3,7,101,18]
输出: 4
解释: 最长的上升子序列是 [2,3,7,101],它的长度是 4。
说明:
可能会有多种最长上升子... | 25.767123 | 78 | 0.515683 |
389d2664817190f14f2ff605dd9fbd0fc535ea02 | 1,396 | py | Python | linux/userspace/maven_us/maven_netrule.py | petergyorgy/virtue | 3b4dbfbdf9f5e121d9c9887d675fdd3065ecdd3b | [
"BSD-3-Clause"
] | null | null | null | linux/userspace/maven_us/maven_netrule.py | petergyorgy/virtue | 3b4dbfbdf9f5e121d9c9887d675fdd3065ecdd3b | [
"BSD-3-Clause"
] | null | null | null | linux/userspace/maven_us/maven_netrule.py | petergyorgy/virtue | 3b4dbfbdf9f5e121d9c9887d675fdd3065ecdd3b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import argparse
import re
import maven_us
# from https://www.adampalmer.me/iodigitalsec/2014/11/21/performing-dns-queries-python/
import dns.resolver
myResolver = dns.resolver.Resolver()
def get_ips_from_domain( domain ):
try:
return [str(a) for a in myResolver.query(domain, "A")]
except:
ret... | 26.339623 | 87 | 0.676218 |
389d32d90c0c07fada9ee8d3725227ee2ac450c5 | 416 | py | Python | one-get/util/http_util.py | wenbindu/HungryTools | 7b44d373784246e215e82d6278bf97c7b1afcb95 | [
"MIT"
] | null | null | null | one-get/util/http_util.py | wenbindu/HungryTools | 7b44d373784246e215e82d6278bf97c7b1afcb95 | [
"MIT"
] | null | null | null | one-get/util/http_util.py | wenbindu/HungryTools | 7b44d373784246e215e82d6278bf97c7b1afcb95 | [
"MIT"
] | null | null | null | import functools
import time
def retry(max=3, time_sleep=2):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
attemp = 0
while attemp < max:
try:
return func(*args, **kwargs)
except:
... | 23.111111 | 48 | 0.473558 |
389d76e6c8021d4d1669eeb794efe7578eb82053 | 1,183 | py | Python | test/unittests/test_LuDisLoad.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_LuDisLoad.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_LuDisLoad.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.Output.Loading import LuDisLoad
class TestLuDisLoad(VariableUnitTest):
def test_LuDisLoad(self):
z = self.z
np.testing.assert_array_almost_equal(
LuDisLoad.LuDisLoad_f(z.NYrs, z.DaysMonth, z.InitSnow_0, z.Tem... | 51.434783 | 117 | 0.540997 |
389d79958b74804a6759eb65bbc9e173db8aab39 | 135 | py | Python | bin.src/forcedPhotCoaddDiaSrc.py | LSSTDESC/dia_pipe | 64121a09a05c67f9dcf93714f9cff2d9c911d12b | [
"BSD-3-Clause"
] | 2 | 2019-06-17T03:03:04.000Z | 2019-07-07T23:47:04.000Z | bin.src/forcedPhotCoaddDiaSrc.py | LSSTDESC/dia_pipe | 64121a09a05c67f9dcf93714f9cff2d9c911d12b | [
"BSD-3-Clause"
] | 20 | 2019-05-09T22:24:12.000Z | 2021-02-11T18:57:25.000Z | bin.src/forcedPhotCoaddDiaSrc.py | LSSTDESC/dia_pipe | 64121a09a05c67f9dcf93714f9cff2d9c911d12b | [
"BSD-3-Clause"
] | 2 | 2019-06-11T21:08:16.000Z | 2019-07-29T18:24:45.000Z | #!/usr/bin/env python
from lsst.dia.pipe.forcedPhotCoaddDiaSrc import ForcedPhotCoaddDiaSrcTask
ForcedPhotCoaddDiaSrcTask.parseAndRun() | 45 | 73 | 0.874074 |
389db287f794f6f58fc81ffed9a32d5f50567955 | 5,554 | py | Python | FasterR-CNN_Demo/Database/ImgAugmentation.py | pkasten/Chiral-molecule-detection | fdeac581484b2b058eff863e2b5cd49b217fc4f5 | [
"MIT"
] | 2 | 2021-02-25T12:58:23.000Z | 2021-11-30T13:03:27.000Z | FasterR-CNN_Demo/Database/ImgAugmentation.py | pkasten/Chiral-molecule-detection | fdeac581484b2b058eff863e2b5cd49b217fc4f5 | [
"MIT"
] | null | null | null | FasterR-CNN_Demo/Database/ImgAugmentation.py | pkasten/Chiral-molecule-detection | fdeac581484b2b058eff863e2b5cd49b217fc4f5 | [
"MIT"
] | 1 | 2021-12-01T15:55:04.000Z | 2021-12-01T15:55:04.000Z | import imgaug.augmenters as iaa
import json
import cv2
dataset_directory = r"E:\PyProjects\FasterR-CNN_Demo\Database\trainset1" # Change dataset directory here
image = cv2.imread(dataset_directory + r"\Images\0.jpg") # Location of the image for dataset generation
Num = 1000 # Number of augmented images
with ... | 44.432 | 120 | 0.533849 |
389db80e8c8891a42b0d5ac5af6fcb655d190e14 | 1,841 | py | Python | src/testlinakdeskapp/gui/test_suspenddetector.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 121 | 2018-09-19T20:10:21.000Z | 2022-03-31T08:07:33.000Z | src/testlinakdeskapp/gui/test_suspenddetector.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 13 | 2020-02-19T15:58:37.000Z | 2022-03-05T03:20:42.000Z | src/testlinakdeskapp/gui/test_suspenddetector.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 12 | 2020-02-13T23:55:30.000Z | 2022-01-30T15:11:31.000Z | # MIT License
#
# Copyright (c) 2017 Arkadiusz Netczuk <dev.arnet@gmail.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
# t... | 34.735849 | 80 | 0.750136 |
389dbcbbb41bb03161f919e37f14fb279aa9a613 | 1,059 | py | Python | core/cost/HMLogJointLikelihoodRWS2.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | null | null | null | core/cost/HMLogJointLikelihoodRWS2.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | null | null | null | core/cost/HMLogJointLikelihoodRWS2.py | szokejokepu/natural-rws | bb1ad4ca3ec714e6bf071d2136593dc853492b68 | [
"MIT"
] | null | null | null | import tensorflow as tf
from core.argo.core.network.AbstractModule import AbstractModule
class HMLogJointLikelihoodRWS2(AbstractModule):
def __init__(self, name="HMLJLRWS"):
super().__init__(name=name)
def create_id(self, cost_fuction_kwargs):
_id = "HMLJLRWS"
return _id
def ... | 31.147059 | 109 | 0.713881 |
389e01a7dbd04e90426ca6d39171e802a2b93f6f | 3,919 | py | Python | tests/test_swf/models/test_domain.py | pgajdos/moto | 9ec0ab45721bbc2f3770c38654d65faa6f562f77 | [
"Apache-2.0"
] | null | null | null | tests/test_swf/models/test_domain.py | pgajdos/moto | 9ec0ab45721bbc2f3770c38654d65faa6f562f77 | [
"Apache-2.0"
] | null | null | null | tests/test_swf/models/test_domain.py | pgajdos/moto | 9ec0ab45721bbc2f3770c38654d65faa6f562f77 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
import sure # noqa
from moto.swf.exceptions import SWFUnknownResourceFault
from moto.swf.models import Domain
# Ensure 'assert_raises' context manager support for Python 2.6
# Fake WorkflowExecution for tests purposes
WorkflowExecution = namedtuple(
"WorkflowExecutio... | 36.626168 | 88 | 0.69431 |
389e06eb63e006dc796a05ffb0954cc00273eff1 | 1,664 | py | Python | intro/debugging.py | RobertoRosa7/python | 449f3908a38814ec7ec3b3ce1051b8abe70069d2 | [
"MIT"
] | null | null | null | intro/debugging.py | RobertoRosa7/python | 449f3908a38814ec7ec3b3ce1051b8abe70069d2 | [
"MIT"
] | 2 | 2020-07-19T15:36:35.000Z | 2022-02-02T20:30:16.000Z | intro/debugging.py | RobertoRosa7/python | 449f3908a38814ec7ec3b3ce1051b8abe70069d2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#! python3
"""
Debugging
"""
import traceback
import os
import logging
# logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') # stdout
logging.basicConfig(filename='python_logs.txt', format='%(asctime)s - %(levelname)s - %(message)s') # file
# l... | 22.794521 | 107 | 0.664063 |
389e150a55bc186786035cbfdca5aac652485790 | 1,581 | py | Python | test/unit/cmds_gen/add_cmd.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | test/unit/cmds_gen/add_cmd.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | test/unit/cmds_gen/add_cmd.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: add_cmd.py
Description: Unit testing of add_cmd in cmds_gen.py.
Usage:
test/unit/cmds_gen/add_cmd.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
import unittest2 as unit... | 17 | 78 | 0.605313 |
389e266928c1e393ac4ba9867912ba7a2ac9cf4d | 1,444 | py | Python | gtirb_functions/__main__.py | GrammaTech/gtirb-functions | 3c8dd20eb4bf9ddcc85f305a4dc3f9ec593a26f1 | [
"MIT"
] | 4 | 2020-04-10T15:19:20.000Z | 2021-03-10T18:53:48.000Z | gtirb_functions/__main__.py | GrammaTech/gtirb-functions | 3c8dd20eb4bf9ddcc85f305a4dc3f9ec593a26f1 | [
"MIT"
] | null | null | null | gtirb_functions/__main__.py | GrammaTech/gtirb-functions | 3c8dd20eb4bf9ddcc85f305a4dc3f9ec593a26f1 | [
"MIT"
] | 1 | 2020-11-06T23:30:39.000Z | 2020-11-06T23:30:39.000Z | #!/usr/bin/python3
#
# Copyright (C) 2020 GrammaTech, Inc.
#
# This code is licensed under the MIT license. See the LICENSE file in
# the project root for license terms.
#
# This project is sponsored by the Office of Naval Research, One Liberty
# Center, 875 N. Randolph Street, Arlington, VA 22203 under contract #
# N6... | 27.769231 | 72 | 0.658587 |
389e4fc008f6a5042544ea4e1a7384b477656522 | 1,082 | py | Python | blog/migrations/0006_auto_20200120_0108.py | SyahmiAmin/belikilo | 0a26dadb514683456ea0dbdcbcfcbf65e09d5dbb | [
"bzip2-1.0.6"
] | null | null | null | blog/migrations/0006_auto_20200120_0108.py | SyahmiAmin/belikilo | 0a26dadb514683456ea0dbdcbcfcbf65e09d5dbb | [
"bzip2-1.0.6"
] | null | null | null | blog/migrations/0006_auto_20200120_0108.py | SyahmiAmin/belikilo | 0a26dadb514683456ea0dbdcbcfcbf65e09d5dbb | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.9 on 2020-01-19 17:08
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0001_squashed_0021'),
('blog', '0005_blogtagindexpage'),
]
oper... | 32.787879 | 157 | 0.603512 |
389e51f52c2602b075d5201736f37fa4864b2a1b | 3,464 | py | Python | generate_from_file.py | riderjensen/tacotron2 | 6d0116fc6c234e72e485c7f81bb6fc5525661ca8 | [
"BSD-3-Clause"
] | 5 | 2020-08-07T21:41:13.000Z | 2020-12-24T02:11:34.000Z | generate_from_file.py | riderjensen/tacotron2 | 6d0116fc6c234e72e485c7f81bb6fc5525661ca8 | [
"BSD-3-Clause"
] | null | null | null | generate_from_file.py | riderjensen/tacotron2 | 6d0116fc6c234e72e485c7f81bb6fc5525661ca8 | [
"BSD-3-Clause"
] | 2 | 2020-07-29T14:56:53.000Z | 2021-12-02T05:54:23.000Z | # Vars to pass: TT2 path, waveglow path, text (.txt file with newlines, or an array), save location, toggle one/multi-file
import argparse
import os
import matplotlib
import matplotlib.pylab as plt
import sys
sys.path.append('waveglow/')
import numpy as np
import torch
import epitran
import eng_to_ipa as ipa
import r... | 34.29703 | 122 | 0.704099 |
389e65ae6bba06c264a0ded784b1f154dfd3835b | 33 | py | Python | depopwatch/__init__.py | WilliamWCYoung/depopwatch | d4e7b5a267a3587396e58e3fb6a7d08eb76e6905 | [
"MIT"
] | 11 | 2016-08-16T15:41:32.000Z | 2022-03-19T01:34:20.000Z | depopwatch/__init__.py | WilliamWCYoung/depopwatch | d4e7b5a267a3587396e58e3fb6a7d08eb76e6905 | [
"MIT"
] | null | null | null | depopwatch/__init__.py | WilliamWCYoung/depopwatch | d4e7b5a267a3587396e58e3fb6a7d08eb76e6905 | [
"MIT"
] | 3 | 2016-08-16T15:41:33.000Z | 2016-08-16T15:44:43.000Z | from .depopwatch import Listener
| 16.5 | 32 | 0.848485 |
389e734933dba8d9a076a912c77d0a666bb1822b | 759 | py | Python | src/anyvar/restapi/routes/sequence_metadata.py | theferrit32/anyvar | 44c30a808155d1510590a9d72a1570307cad6a3a | [
"Apache-2.0"
] | null | null | null | src/anyvar/restapi/routes/sequence_metadata.py | theferrit32/anyvar | 44c30a808155d1510590a9d72a1570307cad6a3a | [
"Apache-2.0"
] | null | null | null | src/anyvar/restapi/routes/sequence_metadata.py | theferrit32/anyvar | 44c30a808155d1510590a9d72a1570307cad6a3a | [
"Apache-2.0"
] | null | null | null | import logging
from connexion import NoContent
from ..globals import get_seqrepo
from .utils import get_sequence_ids, problem
_logger = logging.getLogger(__name__)
def get(alias):
sr = get_seqrepo()
seq_ids = get_sequence_ids(sr, alias)
if not seq_ids:
return NoContent, 404
if len(seq_ids... | 23 | 76 | 0.641634 |
389e8c82543a30ba46853a16fa2dff299baeee34 | 913 | py | Python | client/verta/verta/_swagger/_public/modeldb/model/ModeldbGetExperimentRunsInProjectResponse.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbGetExperimentRunsInProjectResponse.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbGetExperimentRunsInProjectResponse.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from verta._swagger.base_type import BaseType
class ModeldbGetExperimentRunsInProjectResponse(BaseType):
def __init__(self, experiment_runs=None, total_records=None):
required = {
"experiment_runs": False,
"total_records": False,
}
self.experiment_ru... | 29.451613 | 81 | 0.703176 |
389eccf53b27219e7042058e4b2923ca761fd51f | 1,771 | py | Python | common/logging/tests/test_formatters.py | dnguyen0304/python-common | 7fdcc584d223c277e3cdb0336cc923a4f9adcece | [
"MIT"
] | null | null | null | common/logging/tests/test_formatters.py | dnguyen0304/python-common | 7fdcc584d223c277e3cdb0336cc923a4f9adcece | [
"MIT"
] | null | null | null | common/logging/tests/test_formatters.py | dnguyen0304/python-common | 7fdcc584d223c277e3cdb0336cc923a4f9adcece | [
"MIT"
] | 1 | 2018-09-19T00:40:10.000Z | 2018-09-19T00:40:10.000Z | # -*- coding: utf-8 -*-
import json
import logging
from nose.tools import assert_false, assert_in, assert_true
from common.logging import formatters
class TestJsonFormatter:
def __init__(self):
self.formatter = None
self.log_record = None
def setup(self):
fmt = json.dumps({'timest... | 32.2 | 67 | 0.647657 |
389ed9b16b5e153a30705c83e7aa0a8a3a87e2d9 | 7,970 | py | Python | SmallObjectAugmentation/util.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 923 | 2020-01-11T06:36:53.000Z | 2022-03-31T00:26:57.000Z | SmallObjectAugmentation/util.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 25 | 2020-02-27T08:35:46.000Z | 2022-01-25T08:54:19.000Z | SmallObjectAugmentation/util.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 262 | 2020-01-02T02:19:40.000Z | 2022-03-23T04:56:16.000Z | import os
import cv2
import numpy as np
from os.path import join, split
import random
def convert(size, box):
dw = 1. / (size[0])
dh = 1. / (size[1])
x = (box[0] + box[1]) / 2.0 - 1
y = (box[2] + box[3]) / 2.0 - 1
w = box[1] - box[0]
h = box[3] - box[2]
x = x * dw
w = w * dw
y = y ... | 34.95614 | 123 | 0.590213 |
389f0072f9db329fca2897b88f24756d69d67328 | 1,126 | py | Python | tests/test_provider_cloudsmith_io_cloudsmith.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | tests/test_provider_cloudsmith_io_cloudsmith.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | tests/test_provider_cloudsmith_io_cloudsmith.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # tests/test_provider_cloudsmith-io_cloudsmith.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:14:19 UTC)
def test_provider_import():
import terrascript.provider.cloudsmith_io.cloudsmith
def test_resource_import():
from terrascript.resource.cloudsmith_io.cloudsmith import cloudsmith_entitl... | 32.171429 | 84 | 0.792185 |
389f02346a589d93085744508ba856d1d7945d48 | 5,163 | py | Python | domainbed/model_selection.py | odb9402/DomainBed | c1b0ab0f9fb56eaadf22626e809d7914eb92f868 | [
"MIT"
] | 670 | 2020-07-20T16:10:19.000Z | 2022-03-31T07:59:24.000Z | domainbed/model_selection.py | odb9402/DomainBed | c1b0ab0f9fb56eaadf22626e809d7914eb92f868 | [
"MIT"
] | 84 | 2020-07-29T12:04:52.000Z | 2022-03-22T16:34:06.000Z | domainbed/model_selection.py | odb9402/DomainBed | c1b0ab0f9fb56eaadf22626e809d7914eb92f868 | [
"MIT"
] | 197 | 2020-07-20T16:16:45.000Z | 2022-03-30T13:26:09.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import itertools
import numpy as np
def get_test_records(records):
"""Given records with a common test env, get the test records (i.e. the
records with *only* that single test env and no other test envs)"""
return records.filter(lambda... | 36.359155 | 80 | 0.606237 |
389f670d69fef8a29f43077e8fda61641b1f990e | 3,478 | py | Python | rosbuild_ws/src/behaviors/src/behaviors/msg/_Startup.py | Boberito25/ButlerBot | 959f961bbc8c43be0ccb533dd2e2af5c55b0cc2a | [
"BSD-3-Clause"
] | null | null | null | rosbuild_ws/src/behaviors/src/behaviors/msg/_Startup.py | Boberito25/ButlerBot | 959f961bbc8c43be0ccb533dd2e2af5c55b0cc2a | [
"BSD-3-Clause"
] | 1 | 2015-06-08T19:55:40.000Z | 2015-06-08T19:55:40.000Z | rosbuild_ws/src/behaviors/src/behaviors/msg/_Startup.py | Boberito25/ButlerBot | 959f961bbc8c43be0ccb533dd2e2af5c55b0cc2a | [
"BSD-3-Clause"
] | null | null | null | """autogenerated by genpy from behaviors/Startup.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Startup(genpy.Message):
_md5sum = "03729983c4b9be7a4f2b56846a7ccbdc"
_type = "behaviors/Startup"
_has_header = False #flag to mark the presen... | 28.983333 | 91 | 0.643186 |
389f69bcfc27f22be890d7b5bef2b41d7936b770 | 6,360 | py | Python | srs/database.py | MachineLearningStudyGroup/Smart_Review_Summarization | 2f6667b504243d195cea1a3a85af72fdd950d2a8 | [
"MIT"
] | 8 | 2016-06-16T00:21:42.000Z | 2021-03-16T13:15:39.000Z | srs/database.py | MachineLearningStudyGroup/Smart_Review_Summarization | 2f6667b504243d195cea1a3a85af72fdd950d2a8 | [
"MIT"
] | 44 | 2016-03-26T16:54:49.000Z | 2016-09-28T01:49:11.000Z | srs/database.py | MachineLearningStudyGroup/Smart_Review_Summarization | 2f6667b504243d195cea1a3a85af72fdd950d2a8 | [
"MIT"
] | 4 | 2016-03-06T15:54:49.000Z | 2016-06-22T21:40:38.000Z | from pymongo import MongoClient
from srs import settings
import os
import json
def connect_to_db():
client = MongoClient('localhost', 27017)
db = client['srs']
return client, db
def disconnect_db(client):
client.close()
def load_db_from_files():
'''
no useful value anymore
'''
client, db = connect_to_db()
p... | 30 | 193 | 0.755189 |
389f6ca0275c31facdb28fabcbff8cb0e6bca537 | 884 | py | Python | pytype/tests/py2/test_reingest.py | souravbadami/pytype | 804fa97e7f9208df2711976085a96f756b3949e6 | [
"Apache-2.0"
] | 1 | 2020-04-20T02:55:21.000Z | 2020-04-20T02:55:21.000Z | pytype/tests/py2/test_reingest.py | doc22940/pytype | 4772ad6fe89f4df75ae3d08e7374f68074175d4a | [
"Apache-2.0"
] | null | null | null | pytype/tests/py2/test_reingest.py | doc22940/pytype | 4772ad6fe89f4df75ae3d08e7374f68074175d4a | [
"Apache-2.0"
] | null | null | null | """Tests for reloading generated pyi."""
from pytype import file_utils
from pytype.pytd import pytd_utils
from pytype.tests import test_base
class ReingestTest(test_base.TargetPython27FeatureTest):
"""Tests for reloading the pyi we generate."""
def testInstantiatePyiClass(self):
foo = self.Infer("""
i... | 26 | 62 | 0.628959 |
389fa76c9a69ea1e42e0a067632a8575b1ec8883 | 4,036 | py | Python | src/sentry/deletions/defaults/group.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/deletions/defaults/group.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/deletions/defaults/group.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, print_function
import os
from sentry import eventstore, nodestore
from sentry.models import Event, EventAttachment, UserReport
from ..base import BaseDeletionTask, BaseRelation, ModelDeletionTask, ModelRelation
class EventDataDeletionTask(BaseDeletionTask):
"""
Delete... | 33.081967 | 99 | 0.610505 |
389fb4c02c15a958183ee5a974d079ac6b2010b0 | 24,146 | py | Python | common/models.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | common/models.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | common/models.py | gitdaniel228/realtor | 4366d57b064be87b31c8a036b3ed7a99b2036461 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2009 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 or agreed to in writing, ... | 34.201133 | 80 | 0.65398 |
389fcd99898bc4c9de35592bb614cf61eaa79603 | 265 | py | Python | src/apps/ideas/admin.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | null | null | null | src/apps/ideas/admin.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | 48 | 2017-04-21T17:35:23.000Z | 2020-08-29T04:19:35.000Z | src/apps/ideas/admin.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Idea
class IdeaAdmin(admin.ModelAdmin):
list_display = ('type', 'scope', 'title')
list_filter = ('type', 'scope')
search_fields = ('desc', 'results', 'title')
admin.site.register(Idea, IdeaAdmin)
| 22.083333 | 48 | 0.686792 |
389fd3b5dedb97be5cea47be7ff4ea7ae8e77166 | 2,906 | py | Python | functions/land_use.py | NavarreCML/National-EAT-Lancet-Diets | d61ffb59829a64d1bfca3f43e593e656d4543f33 | [
"MIT"
] | null | null | null | functions/land_use.py | NavarreCML/National-EAT-Lancet-Diets | d61ffb59829a64d1bfca3f43e593e656d4543f33 | [
"MIT"
] | null | null | null | functions/land_use.py | NavarreCML/National-EAT-Lancet-Diets | d61ffb59829a64d1bfca3f43e593e656d4543f33 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 2 14:25:53 2020
@author: nicolasnavarre
"""
import pickle
import pandas as pd
def Area_data():
data = 'data/'
df_save = 'df/'
df_plot_org_prod = pickle.load(open(df_save+"Area_min_org_Prod_2", "rb" ))
df_plot_eat_prod = pickle.load... | 30.589474 | 103 | 0.602546 |
389ff158ad0a7d6d78bf64ec54890f45d4d10b87 | 2,647 | py | Python | scripts/python/statistics/Minnesota/run_ameritrak_data_status.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2020-06-03T15:59:50.000Z | 2020-12-21T11:11:57.000Z | scripts/python/statistics/Minnesota/run_ameritrak_data_status.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | null | null | null | scripts/python/statistics/Minnesota/run_ameritrak_data_status.py | OSADP/Pikalert-Vehicle-Data-Translator- | 295da604408f6f13af0301b55476a81311459386 | [
"Apache-2.0"
] | 2 | 2019-10-02T06:47:23.000Z | 2020-02-02T18:32:23.000Z | #!/usr/bin/env python
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2006
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** Research Applications Program(RAP)
# ** P.O.Box 3000, Boulder, Colorado, 80307-3000, ... | 31.511905 | 110 | 0.642614 |
389ffefe17f38133b43d8941ea118322bed1ffe1 | 571 | py | Python | portal/apps/less/tests/django_settings.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 8 | 2020-12-15T17:11:08.000Z | 2021-12-13T22:08:33.000Z | portal/apps/less/tests/django_settings.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 28 | 2020-12-15T17:34:03.000Z | 2022-02-01T04:09:10.000Z | portal/apps/less/tests/django_settings.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 7 | 2020-12-15T19:59:17.000Z | 2021-11-24T16:47:06.000Z | from django.conf.global_settings import *
import os
STATIC_ROOT = MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media')
STATIC_URL = MEDIA_URL = "/media/"
INSTALLED_APPS = (
"less",
)
LESS_MTIME_DELAY = 2
LESS_OUTPUT_DIR = "LESS_CACHE"
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
... | 19.689655 | 75 | 0.549912 |
38a00bb137be66c37a4ed328f359a65cddf7bf83 | 79 | py | Python | fitlins/utils/__init__.py | jdkent/fitlins | 575bb589d1a99622f4cc2fb1c04671132d995091 | [
"Apache-2.0"
] | 1 | 2018-01-24T19:25:06.000Z | 2018-01-24T19:25:06.000Z | fitlins/utils/__init__.py | jdkent/fitlins | 575bb589d1a99622f4cc2fb1c04671132d995091 | [
"Apache-2.0"
] | 10 | 2017-10-25T20:09:40.000Z | 2019-09-20T18:20:55.000Z | fitlins/utils/__init__.py | jdkent/fitlins | 575bb589d1a99622f4cc2fb1c04671132d995091 | [
"Apache-2.0"
] | 1 | 2019-02-27T05:05:32.000Z | 2019-02-27T05:05:32.000Z | from .strings import snake_to_camel
from .collections import dict_intersection
| 26.333333 | 42 | 0.873418 |
38a07be30d5c0bfc0335a695abd2926dcff738c2 | 4,762 | py | Python | rlkit/core/rl_algorithm.py | naomilwx/rlkit | d4514f89e4cef0a93a936c4f6b34b2099ae3a523 | [
"MIT"
] | null | null | null | rlkit/core/rl_algorithm.py | naomilwx/rlkit | d4514f89e4cef0a93a936c4f6b34b2099ae3a523 | [
"MIT"
] | null | null | null | rlkit/core/rl_algorithm.py | naomilwx/rlkit | d4514f89e4cef0a93a936c4f6b34b2099ae3a523 | [
"MIT"
] | null | null | null | import abc
from collections import OrderedDict
import gtimer as gt
from rlkit.core.logging import append_log
from rlkit.core import logger, eval_util
from rlkit.data_management.replay_buffer import ReplayBuffer
from rlkit.samplers.data_collector import DataCollector
from rlkit.core.timer import timer
def _get_epoc... | 35.804511 | 80 | 0.637967 |
38a088f80085e1bf1a76965e980323a72303d07d | 48 | py | Python | models/__init__.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | 58 | 2019-03-14T20:13:10.000Z | 2022-03-17T07:59:34.000Z | models/__init__.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | 7 | 2019-03-29T05:13:39.000Z | 2021-02-08T23:00:32.000Z | models/__init__.py | HapKoM/pyhowfar | b12c248f696dc9bc2b50455b63a2b6ca7a440ba7 | [
"BSD-3-Clause"
] | 14 | 2017-12-19T09:48:10.000Z | 2022-01-10T08:14:43.000Z | from .fan import *
from .recurrent_fan import *
| 16 | 28 | 0.75 |
38a0a66315c95fa13defdcf018518408b3a23212 | 488 | py | Python | wargame/designpatterns/pythonic_elfrider.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | 1 | 2020-12-01T20:30:27.000Z | 2020-12-01T20:30:27.000Z | wargame/designpatterns/pythonic_elfrider.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | wargame/designpatterns/pythonic_elfrider.py | jeantardelli/wargameRepo | 1e11ae40281f7eafa65ea6e40e045304b20e3824 | [
"MIT"
] | null | null | null | """pythonic_elfrider
This is one of the different GameUnits that are used in the desing patterns examples.
:copyright: 2020, Jean Tardelli
:license: The MIT license (MIT). See LICENSE file for further details.
"""
from pythonic_abstractgameunit import AbstractGameUnit
class ElfRider(AbstractGameUnit):
"""Create... | 30.5 | 85 | 0.731557 |
38a0ab2328d4dee85dd076ac87ce3ca0111df624 | 17,115 | py | Python | 42_Google_Hash_Code/pizza_ml_0/game.py | gguarnay/42 | de524031196771ba89af172485af896e37dd13f5 | [
"Unlicense"
] | 1 | 2019-03-03T05:13:05.000Z | 2019-03-03T05:13:05.000Z | 42_Google_Hash_Code/pizza_ml_0/game.py | gguarnay/42 | de524031196771ba89af172485af896e37dd13f5 | [
"Unlicense"
] | null | null | null | 42_Google_Hash_Code/pizza_ml_0/game.py | gguarnay/42 | de524031196771ba89af172485af896e37dd13f5 | [
"Unlicense"
] | null | null | null | from google_engineer import GoogleEngineer
from pizza import Pizza
import numpy as np
import json
import os
class StandardInput:
def next(self):
return input('')
class KeyInput:
key_to_action = {
'w': 'up',
'a': 'left',
's': 'down',
'd': 'right',
' ': 'toggle',... | 41.743902 | 129 | 0.521998 |
38a0ee094c2efdee7bc50ef42dc37eae0c9bf47a | 1,553 | py | Python | apps/mymedicare_cb/tests/responses.py | TransparentHealth/bluebutton-web-server | 69b6e649b2e9caf7859a75ea3867bf74c83ca340 | [
"Apache-2.0"
] | 1 | 2020-01-26T16:02:27.000Z | 2020-01-26T16:02:27.000Z | apps/mymedicare_cb/tests/responses.py | TransparentHealth/bluebutton-web-server | 69b6e649b2e9caf7859a75ea3867bf74c83ca340 | [
"Apache-2.0"
] | null | null | null | apps/mymedicare_cb/tests/responses.py | TransparentHealth/bluebutton-web-server | 69b6e649b2e9caf7859a75ea3867bf74c83ca340 | [
"Apache-2.0"
] | 2 | 2018-09-29T18:53:08.000Z | 2020-01-26T16:02:31.000Z | patient_response = {
"resourceType": "Bundle",
"id": "d0c10556-a3df-4af6-bdb3-d60908b1f16b",
"meta": {
"lastUpdated": "2018-04-05T15:44:17.721-04:00"
},
"type": "searchset",
"total": 1,
"entry": [{
"fullUrl": "https://sandbox.bluebutton.cms.gov/v1/fhir/Patient/19990000000001"... | 33.042553 | 91 | 0.432067 |
38a1022dcf998cbd3f0322703ca1943acc12d6ce | 806 | py | Python | evaluate.py | henryhust/Coreference-Chinese | 21b8edba978a3e3f0fe055d3d3f2269f6616593b | [
"Apache-2.0"
] | null | null | null | evaluate.py | henryhust/Coreference-Chinese | 21b8edba978a3e3f0fe055d3d3f2269f6616593b | [
"Apache-2.0"
] | null | null | null | evaluate.py | henryhust/Coreference-Chinese | 21b8edba978a3e3f0fe055d3d3f2269f6616593b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
import util
def read_doc_keys(fname):
keys = set()
with open(fname) as f:
for line in f:
keys.add(line.strip())
return k... | 27.793103 | 101 | 0.700993 |
38a1362f200c90bfbf8652006502c317f9b2f790 | 903 | py | Python | odin/models/keras_xor.py | Anderssorby/odin | 844dd2ec32a7c3e15959c86ad93659e7de131064 | [
"MIT"
] | null | null | null | odin/models/keras_xor.py | Anderssorby/odin | 844dd2ec32a7c3e15959c86ad93659e7de131064 | [
"MIT"
] | null | null | null | odin/models/keras_xor.py | Anderssorby/odin | 844dd2ec32a7c3e15959c86ad93659e7de131064 | [
"MIT"
] | null | null | null | import numpy as np
from keras.models import Sequential
from keras.layers.core import Dense
from odin.models.keras_base import KerasModelWrapper
class KerasXOR(KerasModelWrapper):
model_name = 'keras_xor'
# the four different states of the XOR gate
x_train = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], "flo... | 29.129032 | 67 | 0.621262 |
38a1610ab6c2f9aef3f07366d61fa55ea6748a9e | 2,481 | py | Python | python/inicio.py | VictorCastao/VictorCastao.github.io | 7c075d6dc208b57b86c1352c9edd3bfcc239e22b | [
"MIT"
] | null | null | null | python/inicio.py | VictorCastao/VictorCastao.github.io | 7c075d6dc208b57b86c1352c9edd3bfcc239e22b | [
"MIT"
] | null | null | null | python/inicio.py | VictorCastao/VictorCastao.github.io | 7c075d6dc208b57b86c1352c9edd3bfcc239e22b | [
"MIT"
] | null | null | null | #tipos basicos
a = 1 #inteiros
b = 1.2 #ponto flutuante
c = 'c' #string
d = "lorem ipsum noldo" #string
e = d[3] #caractere
print(a,b,c,d,e)
#operadores matematicos: + - * / // % **
x = 1+2 #soma
y = 4-3 #subtração
z = 5/2 # divisão ponto flutuante
w = 5//2 #divisão inteira
u = 5%2 # módulo (resto da divisão)
v ... | 18.242647 | 76 | 0.585248 |
38a17b8a6b7ede865a9c2d70c3c029516faa81d2 | 14,398 | py | Python | ucscsdk/mometa/vnic/VnicMonSesFc.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/vnic/VnicMonSesFc.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/vnic/VnicMonSesFc.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for VnicMonSesFc ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class VnicMonSesFcConsts():
ADMIN_HOST_PORT_1 = "1"
ADMIN_HOST_PORT_2 = "2"
ADMIN_HOST... | 81.806818 | 3,445 | 0.707668 |
38a198e942ed62c45ea6454e93794b7351c990e5 | 17,711 | py | Python | abb_python/src/abb_reach.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | 2 | 2019-02-28T01:47:23.000Z | 2021-04-10T14:37:46.000Z | abb_python/src/abb_reach.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | abb_python/src/abb_reach.py | karim174/brain-computer-interface-and-vision-based-autonomous-agent-for-shared-control-over-robotic-arm | d099cad43bfb98261c2571991f4e163d444b62b4 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import ray
import time
import rospy
import cv2
import tf
import os
import atexit
import json
import random
import signal
import subprocess
import sys
import traceback
import numpy as np
import random
from geometry_msgs.msg import PointStamped
import image_geometry
from gym import utils
from gym ... | 43.409314 | 169 | 0.600248 |
38a1d0f638b5e8a0cbbe49f52e59e5345513b0dc | 615 | py | Python | TgBot/handlers/users/help.py | Na3aga/gmbot | c6fa37d4d61a9b023dc36197961706dbcd371e72 | [
"MIT"
] | null | null | null | TgBot/handlers/users/help.py | Na3aga/gmbot | c6fa37d4d61a9b023dc36197961706dbcd371e72 | [
"MIT"
] | 21 | 2019-10-23T21:16:18.000Z | 2021-08-02T21:43:46.000Z | TgBot/handlers/users/help.py | Na3aga/gmbot | c6fa37d4d61a9b023dc36197961706dbcd371e72 | [
"MIT"
] | 1 | 2019-10-25T23:01:25.000Z | 2019-10-25T23:01:25.000Z | from aiogram import types
from aiogram.dispatcher.filters.builtin import CommandHelp
from TgBot.loader import dp
from TgBot.utils.misc import rate_limit
@rate_limit(5, 'help')
@dp.message_handler(CommandHelp())
async def bot_help(message: types.Message):
text = [
'Список команд: ',
'/start - Поча... | 29.285714 | 71 | 0.666667 |
38a1fde6309e0bad91f4d27d279901a55ac29d43 | 8,233 | py | Python | src/py42/services/detectionlists/departing_employee.py | ryanvanasse/py42 | 4664c45d41c32f48323b552b7b11f885c055bff3 | [
"MIT"
] | null | null | null | src/py42/services/detectionlists/departing_employee.py | ryanvanasse/py42 | 4664c45d41c32f48323b552b7b11f885c055bff3 | [
"MIT"
] | null | null | null | src/py42/services/detectionlists/departing_employee.py | ryanvanasse/py42 | 4664c45d41c32f48323b552b7b11f885c055bff3 | [
"MIT"
] | null | null | null | from datetime import datetime
from py42.exceptions import Py42BadRequestError
from py42.exceptions import Py42NotFoundError
from py42.exceptions import Py42UserNotOnListError
from py42.services import BaseService
from py42.services.detectionlists import _DetectionListFilters
from py42.services.detectionlists import _P... | 39.392344 | 126 | 0.65201 |
38a1fe089879c65c367e25e846a2b3a90c346d05 | 149,896 | py | Python | pytype/vm.py | google/pytype | b5a40b8afb497a2217fc366492b894c027383c83 | [
"Apache-2.0"
] | 3,882 | 2015-03-22T12:17:15.000Z | 2022-03-31T17:13:20.000Z | pytype/vm.py | google/pytype | b5a40b8afb497a2217fc366492b894c027383c83 | [
"Apache-2.0"
] | 638 | 2015-11-03T06:34:44.000Z | 2022-03-31T23:41:48.000Z | pytype/vm.py | google/pytype | b5a40b8afb497a2217fc366492b894c027383c83 | [
"Apache-2.0"
] | 301 | 2015-08-14T10:21:17.000Z | 2022-03-08T11:03:40.000Z | """A abstract virtual machine for python bytecode.
A VM for python byte code that uses pytype/pytd/cfg to generate a trace of the
program execution.
"""
# Because pytype takes too long:
# pytype: skip-file
# We have names like "byte_NOP":
# pylint: disable=invalid-name
# Bytecodes don't always use all their argumen... | 39.571278 | 80 | 0.671192 |
38a1fe71f094a4b8acf2a66f2a902b1d3faf1175 | 5,736 | py | Python | homeassistant/const.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | homeassistant/const.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | homeassistant/const.py | SKarthick5121995/karthickmaduraai | d5498dfb83e9bb57fff16db854ae3e15c1e15425 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Constants used by Home Assistant components."""
__version__ = "0.16.1"
REQUIRED_PYTHON_VER = (3, 4)
# Can be used to specify a catch all when registering state or event listeners.
MATCH_ALL = '*'
# If no name is specified
DEVICE_DEFAULT_NAME = "Unnamed Device"
# #### CONFIG ####
CONF_ICON = "icon... | 26.929577 | 79 | 0.782078 |
38a235d8e860c276c6108355c3c0248809501401 | 1,859 | py | Python | view/gfx.py | 1amG4bor/PySnake | 40499856ef4c711db46de38bc96040b57b2eddf3 | [
"MIT"
] | 1 | 2020-10-08T16:35:11.000Z | 2020-10-08T16:35:11.000Z | view/gfx.py | 1amG4bor/PySnake | 40499856ef4c711db46de38bc96040b57b2eddf3 | [
"MIT"
] | null | null | null | view/gfx.py | 1amG4bor/PySnake | 40499856ef4c711db46de38bc96040b57b2eddf3 | [
"MIT"
] | null | null | null | """
Serves out the frequently used common UI elements by rendering them
"""
import pygame
from config import Colors
import pygame.gfxdraw as draw
canvas = None
default_font = 'BreeSerif-Regular.ttf'
def set_screen(screen):
global canvas
canvas = screen
def draw_line(line_position, line_size, color=Colors.... | 35.75 | 107 | 0.683163 |
38a24821f0526269dc42a61e5c28dc80086b1992 | 501 | py | Python | tests/unit/unit_test_doze.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_doze.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_doze.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | '''
Created on Sep 21, 2017
@author: bhoff
'''
import synapseclient.dozer as doze
def teardown():
doze.clear_listeners()
def test_doze():
class CounterClass(object):
def __init__(self):
self.val = 0
def __call__(self):
self.val = self.val + 1
... | 18.555556 | 59 | 0.586826 |
38a2599b8f930cfb4c58f3a9d2ba97e70c7d98ab | 1,326 | py | Python | addutils/generic.py | addfor/AddUtils | 2e2eb7ecd0718c7ec88a72b59313ab9084c0eaac | [
"MIT"
] | null | null | null | addutils/generic.py | addfor/AddUtils | 2e2eb7ecd0718c7ec88a72b59313ab9084c0eaac | [
"MIT"
] | null | null | null | addutils/generic.py | addfor/AddUtils | 2e2eb7ecd0718c7ec88a72b59313ab9084c0eaac | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2015 addfor s.r.l.
#
# 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... | 44.2 | 80 | 0.726244 |
38a26088f4f7452cc98bfe8f58ecd402e1c1fc51 | 15,328 | py | Python | api/src/opentrons/protocols/parse.py | soroushjp/opentrons | f7e82834417630d5e6c90ed452de35d80eb1be8a | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocols/parse.py | soroushjp/opentrons | f7e82834417630d5e6c90ed452de35d80eb1be8a | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocols/parse.py | soroushjp/opentrons | f7e82834417630d5e6c90ed452de35d80eb1be8a | [
"Apache-2.0"
] | null | null | null | """
opentrons.protocols.parse: functions and state for parsing protocols
"""
import ast
import functools
import itertools
import json
import logging
import re
from io import BytesIO
from zipfile import ZipFile
from typing import Any, Dict, Optional, Union, Tuple, TYPE_CHECKING
import jsonschema # type: ignore
from ... | 38.805063 | 78 | 0.656641 |
38a28dce43bb191a3454ca2f1ea2904104a0eb65 | 1,248 | py | Python | profiles/templatetags/profilestags.py | moonbirddk/networked-toolbox | b059b77bfda173794b3cad55874cb06edc70d0e1 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2016-09-02T12:45:31.000Z | 2018-02-10T10:18:11.000Z | profiles/templatetags/profilestags.py | Socialsquare/networked-toolbox | b059b77bfda173794b3cad55874cb06edc70d0e1 | [
"BSD-2-Clause-FreeBSD"
] | 17 | 2020-03-24T15:58:05.000Z | 2022-02-10T08:08:57.000Z | profiles/templatetags/profilestags.py | moonbirddk/networked-toolbox | b059b77bfda173794b3cad55874cb06edc70d0e1 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2018-01-05T08:02:18.000Z | 2018-01-05T08:02:18.000Z | from django import template
from ..utils import get_profile_photo_url
register = template.Library()
@register.inclusion_tag('profiles/_profile_photo.html')
def render_profile_photo(user, show_link=True):
"""
{% render_profile_photo user %}
"""
try:
photo_url = get_profile_photo_url(user)
... | 25.469388 | 73 | 0.58734 |
38a28ffe4ac6a6a1c466b111448040120134f4ae | 2,954 | py | Python | jinjamator/external/rest_client/request.py | jinjamator/jinjamator-core | 928a6db56a20f57d6f7dc66fb46de71de945817e | [
"Apache-2.0"
] | 7 | 2020-05-06T07:48:14.000Z | 2021-12-11T15:57:26.000Z | jinjamator/external/rest_client/request.py | jinjamator/jinjamator-core | 928a6db56a20f57d6f7dc66fb46de71de945817e | [
"Apache-2.0"
] | 1 | 2020-04-11T15:13:07.000Z | 2020-04-27T20:01:34.000Z | jinjamator/external/rest_client/request.py | jinjamator/jinjamator-core | 928a6db56a20f57d6f7dc66fb46de71de945817e | [
"Apache-2.0"
] | 1 | 2020-05-29T08:53:08.000Z | 2020-05-29T08:53:08.000Z | import logging
from .decorators import handle_async_request_error, handle_request_error
from .models import Response
logger = logging.getLogger(__name__)
@handle_request_error
def make_request(client, request):
logger.debug("operation=request_started, request=%r", request)
method = request.method
client... | 32.461538 | 80 | 0.650982 |
38a292ef409ded41746e3a5b473de57701f87eed | 735 | py | Python | profiles/migrations/0005_auto_20201216_2351.py | kevin-ci/janeric2 | df07508a76ad8194a63be7786d8b84a905b3d2e9 | [
"MIT"
] | 1 | 2021-02-28T11:54:14.000Z | 2021-02-28T11:54:14.000Z | profiles/migrations/0005_auto_20201216_2351.py | kevin-ci/janeric2 | df07508a76ad8194a63be7786d8b84a905b3d2e9 | [
"MIT"
] | 6 | 2021-12-01T11:39:03.000Z | 2021-12-04T22:28:57.000Z | profiles/migrations/0005_auto_20201216_2351.py | kevin-ci/janeric2 | df07508a76ad8194a63be7786d8b84a905b3d2e9 | [
"MIT"
] | 1 | 2021-12-21T16:20:49.000Z | 2021-12-21T16:20:49.000Z | # Generated by Django 3.1.4 on 2020-12-16 23:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0004_userprofile_birthday'),
]
operations = [
migrations.RemoveField(
model_name='userprofile',
name='bi... | 26.25 | 74 | 0.594558 |
38a2d4244d2a6f753862822904c8f04cb7a17507 | 9,712 | py | Python | src/retrie/retrie.py | pombredanne/retrie | 2ff5e55acc2aaa06c62873e8b0b3676985c94736 | [
"MIT"
] | 31 | 2020-04-09T16:57:39.000Z | 2022-03-08T15:54:24.000Z | src/retrie/retrie.py | pombredanne/retrie | 2ff5e55acc2aaa06c62873e8b0b3676985c94736 | [
"MIT"
] | 4 | 2020-05-01T17:40:51.000Z | 2021-07-08T07:19:39.000Z | src/retrie/retrie.py | pombredanne/retrie | 2ff5e55acc2aaa06c62873e8b0b3676985c94736 | [
"MIT"
] | 4 | 2020-06-05T08:32:45.000Z | 2021-07-01T23:49:31.000Z | import re
from typing import (
Any,
Dict,
Iterator,
Mapping,
Match,
Optional,
Pattern,
Sequence,
Text,
)
from . import cached_property, trie # noqa:ABS101
re_flag_type = Optional[int]
DEFAULT_FLAGS = re.IGNORECASE | re.UNICODE # on py3, re.UNICODE is always enabled
WORD_BOUNDARY... | 32.700337 | 95 | 0.59514 |
38a2d491bbcee718741e3cb717dbbf6479dbe644 | 6,148 | py | Python | dtor/opts.py | Tevien/dtor | bb2954074d4a299c129d44afd722084980b792b5 | [
"MIT"
] | null | null | null | dtor/opts.py | Tevien/dtor | bb2954074d4a299c129d44afd722084980b792b5 | [
"MIT"
] | 1 | 2021-03-12T10:57:24.000Z | 2021-03-12T10:57:24.000Z | dtor/opts.py | Tevien/dtor | bb2954074d4a299c129d44afd722084980b792b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Process all the options"""
__author__ = "Sean Benson"
__copyright__ = "MIT"
import json
import argparse
norms = {
'torchvision_3d': ([0.43216, 0.394666, 0.37645],
[0.22803, 0.22145, 0.216989]),
'torchvision_2d': ([0.485, 0.456, 0.406],
... | 37.260606 | 91 | 0.357352 |
38a2ebb42918631c485d791ce790b1ae03620ef0 | 1,885 | py | Python | py/levels/pool.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 2 | 2020-01-04T23:44:10.000Z | 2020-07-12T17:10:09.000Z | py/levels/pool.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | null | null | null | py/levels/pool.py | triffid/kiki | b64b8524063c149a5cc9118f48d80afec1d8a942 | [
"Unlicense"
] | 1 | 2022-03-16T05:43:33.000Z | 2022-03-16T05:43:33.000Z | # level design by Michael Abel
# .................................................................................................................
def func_pool():
s=world.getSize()
d=1
for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range( s.z/2-1)]:
if (-1)**(i+j+l) ==1 and not ( d<... | 37.7 | 117 | 0.333156 |
38a2f4fa113b9ca3ce8f488b1236d0ecfcd02cac | 780 | py | Python | setup.py | swannapa/meeting5 | abc3acf635575592bca1d85c360d598ea48ce6c3 | [
"MIT"
] | null | null | null | setup.py | swannapa/meeting5 | abc3acf635575592bca1d85c360d598ea48ce6c3 | [
"MIT"
] | null | null | null | setup.py | swannapa/meeting5 | abc3acf635575592bca1d85c360d598ea48ce6c3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from pip.req import parse_requirements
import re, ast
# get version from __version__ variable in meeting5/__init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('meeting5/__init__.py', 'rb') as f:
version = str(ast.literal_eval... | 28.888889 | 68 | 0.737179 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.