hexsha
stringlengths
40
40
size
int64
5
2.06M
ext
stringclasses
11 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
3
251
max_stars_repo_name
stringlengths
4
130
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
251
max_issues_repo_name
stringlengths
4
130
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
251
max_forks_repo_name
stringlengths
4
130
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
1
1.05M
avg_line_length
float64
1
1.02M
max_line_length
int64
3
1.04M
alphanum_fraction
float64
0
1
23793e314023b1afee56b5645d0f4bbfd1a679ef
1,098
py
Python
jaxvi/models.py
sagar87/jaxvi
78829552589f8d44082cf8a1a8e02da549d7c298
[ "MIT" ]
null
null
null
jaxvi/models.py
sagar87/jaxvi
78829552589f8d44082cf8a1a8e02da549d7c298
[ "MIT" ]
null
null
null
jaxvi/models.py
sagar87/jaxvi
78829552589f8d44082cf8a1a8e02da549d7c298
[ "MIT" ]
null
null
null
from abc import abstractmethod from jaxvi.abstract import ABCMeta, abstract_attribute import jax.numpy as jnp from jax.scipy.stats import norm, gamma
27.45
67
0.644809
237f62f7caaf963fa09ab8afd9854d8138aec5f6
696
py
Python
testfile/upsampling.py
otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer
bbda81dc7b52f42e07e9daaff38ce7453b24e008
[ "MIT" ]
1
2020-10-18T03:33:16.000Z
2020-10-18T03:33:16.000Z
testfile/upsampling.py
otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer
bbda81dc7b52f42e07e9daaff38ce7453b24e008
[ "MIT" ]
null
null
null
testfile/upsampling.py
otsubo/CIFAR-ConvolutionalAutoEncoder-Chainer
bbda81dc7b52f42e07e9daaff38ce7453b24e008
[ "MIT" ]
1
2019-12-03T10:19:17.000Z
2019-12-03T10:19:17.000Z
# -*- coding: utf-8 -*- """ Created on Sat Jul 21 22:59:41 2018 @author: user """ import chainer import numpy as np import chainer.functions as F x = np.arange(1, 37).reshape(1, 1, 6, 6).astype(np.float32) x = chainer.Variable(x) print(x) pooled_x, indexes = F.max_pooling_2d(x, ksize=2, stride=2, return_indices=True) print(pooled_x) print(indexes) upsampled_x = F.upsampling_2d(pooled_x, indexes, ksize=2, stride=2, outsize=x.shape[2:]) print(upsampled_x.shape) print(upsampled_x.data) upsampled_x = F.unpooling_2d(pooled_x, ksize=2, stride=2, outsize=x.shape[2:]) print(upsampled_x.shape) print(upsampled_x.data) # KerasupsamplingChainerunpooling # Chainerupsamplingindexes
24
88
0.752874
2380077f114b5b16cc9a1100bc690d9cd9597308
36
py
Python
coding/kakov-budet-vyvod-dlja-var-2-1/code.py
mowshon/python-quiz
215fb23dbb0fa42b438f988e49172b87b48bade3
[ "MIT" ]
2
2020-07-17T21:08:26.000Z
2020-08-16T03:12:07.000Z
coding/kakov-budet-vyvod-dlja-var-2-1/code.py
mowshon/python-quiz
215fb23dbb0fa42b438f988e49172b87b48bade3
[ "MIT" ]
2
2021-06-08T22:04:35.000Z
2022-01-13T03:03:32.000Z
coding/kakov-budet-vyvod-dlja-var-2-1/code.py
mowshon/python-quiz
215fb23dbb0fa42b438f988e49172b87b48bade3
[ "MIT" ]
null
null
null
var = "James Bond" print(var[2::-1])
18
18
0.611111
2380742d81c7c52a33d552870a8c7044b79787a1
1,322
py
Python
src/ui_templates/wizard_depend_depend_version.py
GandaG/fomod-designer
0bd333f33286adfaebecd5c2561f3aadaa017de0
[ "Apache-2.0" ]
15
2016-05-31T22:41:19.000Z
2022-01-13T07:51:43.000Z
src/ui_templates/wizard_depend_depend_version.py
GandaG/fomod-designer
0bd333f33286adfaebecd5c2561f3aadaa017de0
[ "Apache-2.0" ]
42
2016-05-20T18:30:45.000Z
2019-07-18T20:27:37.000Z
src/ui_templates/wizard_depend_depend_version.py
GandaG/fomod-editor
0bd333f33286adfaebecd5c2561f3aadaa017de0
[ "Apache-2.0" ]
3
2016-10-16T18:23:28.000Z
2018-11-24T12:08:09.000Z
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'resources/templates/wizard_depend_depend_version.ui' # # Created by: PyQt5 UI code generator 5.5.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets
37.771429
106
0.708775
2381759676c1a13a9190cbf2cbe7006518dd9448
1,093
py
Python
behaviour/models.py
red-and-black/friendly
f453344ad1e9173ad3545e4ea0c825b65190b3c5
[ "Apache-2.0" ]
2
2020-01-28T12:56:56.000Z
2021-07-02T03:07:39.000Z
behaviour/models.py
red-and-black/friendly
f453344ad1e9173ad3545e4ea0c825b65190b3c5
[ "Apache-2.0" ]
5
2021-03-18T23:02:11.000Z
2021-09-17T11:02:08.000Z
behaviour/models.py
red-and-black/goodchat
1a391a04d4edfbcefaf87663f08308dd58578634
[ "Apache-2.0" ]
null
null
null
from django.db import models
25.418605
66
0.651418
2381e2b9c699c0ba9541e7eef0d109d8c8508180
121
py
Python
setup.py
m0hithreddy/rpyc-mem
72e46da34fe2165a89d702a02ec0bb7b6d64775e
[ "MIT" ]
1
2022-03-12T23:29:13.000Z
2022-03-12T23:29:13.000Z
setup.py
m0hithreddy/rpyc-mem
72e46da34fe2165a89d702a02ec0bb7b6d64775e
[ "MIT" ]
null
null
null
setup.py
m0hithreddy/rpyc-mem
72e46da34fe2165a89d702a02ec0bb7b6d64775e
[ "MIT" ]
null
null
null
from setuptools import setup setup( version=open("rpyc_mem/_version.py").readlines()[-1].split()[-1].strip("\"'") )
20.166667
81
0.661157
23823d970e12e704ee8efa4de2524ea2db2fa2ba
957
py
Python
myblog/blog/migrations/0001_initial.py
LikeLion-CAU-9th/spring-concept-blog
e1e16c5489a3b96d45d91bc43e15297270293dcb
[ "MIT" ]
null
null
null
myblog/blog/migrations/0001_initial.py
LikeLion-CAU-9th/spring-concept-blog
e1e16c5489a3b96d45d91bc43e15297270293dcb
[ "MIT" ]
null
null
null
myblog/blog/migrations/0001_initial.py
LikeLion-CAU-9th/spring-concept-blog
e1e16c5489a3b96d45d91bc43e15297270293dcb
[ "MIT" ]
3
2021-08-10T19:00:18.000Z
2021-08-11T00:53:09.000Z
# Generated by Django 3.2.2 on 2021-05-10 06:15 from django.db import migrations, models import django.utils.timezone
35.444444
169
0.592476
88bb3f59329f873d5176f1525a62f453fd0b978d
2,879
py
Python
dockermap/map/runner/cmd.py
merll/docker-map
54e325595fc0b6b9d154dacc790a222f957895da
[ "MIT" ]
85
2015-01-02T01:05:14.000Z
2022-03-23T22:23:12.000Z
dockermap/map/runner/cmd.py
merll/docker-map
54e325595fc0b6b9d154dacc790a222f957895da
[ "MIT" ]
21
2015-02-10T18:25:03.000Z
2020-10-28T08:38:39.000Z
dockermap/map/runner/cmd.py
merll/docker-map
54e325595fc0b6b9d154dacc790a222f957895da
[ "MIT" ]
15
2015-02-27T12:19:35.000Z
2021-09-29T06:20:14.000Z
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from ..action import ContainerUtilAction from ..input import ItemType log = logging.getLogger(__name__)
40.549296
115
0.64571
88bba0c5c1fe8347368f3e71bf8ff00b73e46934
846
py
Python
tests/test_question_search_result_parsing.py
regardscitoyens/senapy
84fb9c2228006b99c396f2c5e6a15ba6bae19873
[ "MIT" ]
6
2016-04-11T06:39:43.000Z
2021-06-18T08:52:08.000Z
tests/test_question_search_result_parsing.py
regardscitoyens/senapy
84fb9c2228006b99c396f2c5e6a15ba6bae19873
[ "MIT" ]
8
2016-05-31T19:46:50.000Z
2019-08-30T13:20:27.000Z
tests/test_question_search_result_parsing.py
regardscitoyens/senapy
84fb9c2228006b99c396f2c5e6a15ba6bae19873
[ "MIT" ]
3
2016-05-31T12:36:10.000Z
2017-11-15T19:55:04.000Z
# -*- coding: utf-8 -*- import codecs from senapy.parsing.question_search_result_parser import parse_question_search_result
47
177
0.751773
88bc403d25f54bbc912895c21b6786cdfc90a30c
3,678
py
Python
main.py
PWN0N/Working-Time-lapse
1ebe4cb1a669a1b77528b4f2583e27fdd4e5953b
[ "MIT" ]
null
null
null
main.py
PWN0N/Working-Time-lapse
1ebe4cb1a669a1b77528b4f2583e27fdd4e5953b
[ "MIT" ]
null
null
null
main.py
PWN0N/Working-Time-lapse
1ebe4cb1a669a1b77528b4f2583e27fdd4e5953b
[ "MIT" ]
null
null
null
import signal import numpy as np from PIL import ImageGrab import cv2 import time import sys import os flips_time_mins = 30 interval = 5 # seconds num_frames = flips_time_mins*60/interval num_frames = int(num_frames) year = -1 month = -1 day = -1 out_fps = 24 cammode = 0 shutdown_msg = False capture = cv2.VideoCapture(0) capture1 = cv2.VideoCapture(1) cam, _ = capture.read() cam1, _ = capture1.read() if(cam and cam1): print('Dual Camera Mode') cammode = 1 elif(cam): print('Single Camera Mode') cammode = 2 else: print('No Camera Detect!') sys.exit(0) signal.signal(signal.SIGINT,signal_handler) # capture frames to video while True: if(day != time.strftime("%d")): year = time.strftime("%Y") month = time.strftime("%m") day = time.strftime("%d") hour = time.strftime("%H") save_dir = "{0}/{1}/{2}".format(year, month, day) if not os.path.isdir(save_dir): os.makedirs(save_dir) # innner camera init size = (int(capture.get(cv2.CAP_PROP_FRAME_WIDTH)), int(capture.get(cv2.CAP_PROP_FRAME_HEIGHT))) codec = cv2.VideoWriter.fourcc('M', 'J', 'P', 'G') cam_filename = save_dir+"/cam_{:4}.avi".format(time.strftime("%H%M")) video = cv2.VideoWriter(cam_filename, codec, out_fps, size) # for low quality webcams, discard the starting unstable frames for i in range(20): capture.read() # desktop screen init desktopim = np.array(ImageGrab.grab().convert('RGB')) # desktopFrame =np.array(desktopim.getdata(),dtype='uint8')\ # .reshape((desktopim.size[1],desktopim.size[0],3)) sp = desktopim.shape sz1 = sp[0] # height(rows) of image sz2 = sp[1] # width(colums) of image desktopsize = (int(sz2),int(sz1)) codec = cv2.VideoWriter.fourcc('M', 'J', 'P', 'G') desktop_filename = save_dir+"/desktop_{:4}.avi".format(time.strftime("%H%M")) desktopvideo = cv2.VideoWriter(desktop_filename, codec, out_fps, desktopsize) # outter camera init if (cammode == 1): size1 = (int(capture1.get(cv2.CAP_PROP_FRAME_WIDTH)), int(capture1.get(cv2.CAP_PROP_FRAME_HEIGHT))) cam1_filename = save_dir+"/cam1_{:4}.avi".format(time.strftime("%H%M")) video1 = cv2.VideoWriter(cam1_filename, codec, out_fps, size1) # for low quality webcams, discard the starting unstable frames for i in range(20): capture1.read() for i in range(num_frames): if (shutdown_msg): break _, frame = capture.read() video.write(add_timestamp(frame)) desktopim = np.array(ImageGrab.grab().convert('RGB')) # ImageGrab and OpenCV have different color space desktopFrame = cv2.cvtColor(desktopim, cv2.COLOR_BGR2RGB) desktopvideo.write(add_timestamp(desktopFrame)) if (cammode == 1): _, frame1 = capture1.read() video1.write(add_timestamp(frame1)) time.sleep(interval) video.release() desktopvideo.release() if (cammode == 1): video1.release() if (shutdown_msg): break capture.release() if(cammode ==1): capture1.release() print('Done!') print('Exit The Program') sys.exit(0)
27.244444
83
0.637575
88bd61d6346e9f097545fab6de60f3909f62dcdf
1,823
py
Python
tests/test_tokenizers.py
BMarcin/MordinezNLP
884f6c2ccade8ac796d40d3081560021e96765ca
[ "MIT" ]
1
2021-02-03T19:38:05.000Z
2021-02-03T19:38:05.000Z
tests/test_tokenizers.py
BMarcin/MordinezNLP
884f6c2ccade8ac796d40d3081560021e96765ca
[ "MIT" ]
13
2020-11-30T21:01:56.000Z
2021-03-12T21:23:45.000Z
tests/test_tokenizers.py
BMarcin/MordinezNLP
884f6c2ccade8ac796d40d3081560021e96765ca
[ "MIT" ]
null
null
null
import unittest import spacy from spacy.language import Language try: from src.MordinezNLP.tokenizers import spacy_tokenizer except: from MordinezNLP.tokenizers import spacy_tokenizer if __name__ == '__main__': unittest.main()
26.808824
126
0.397696
88bdb402bf1da07ef8a27f4a47f88d7c557aae53
3,905
py
Python
scripts/autopost/image_maker.py
sahawaee/quotes-indonesia
ef6f0dc5afa460d8da6266f5df89d2a350cc9835
[ "MIT" ]
6
2019-11-02T06:04:37.000Z
2022-03-27T14:41:45.000Z
scripts/autopost/image_maker.py
sahawaee/quotes-indonesia
ef6f0dc5afa460d8da6266f5df89d2a350cc9835
[ "MIT" ]
1
2021-09-29T08:33:14.000Z
2021-11-06T02:10:38.000Z
scripts/autopost/image_maker.py
sahawaee/quotes-indonesia
ef6f0dc5afa460d8da6266f5df89d2a350cc9835
[ "MIT" ]
8
2020-03-21T20:09:38.000Z
2022-03-11T19:14:24.000Z
import random import requests import tempfile from io import BytesIO from PIL import Image, ImageDraw, ImageFont FONTS = [ 'https://cdn.statically.io/gh/google/fonts/main/ofl/neucha/Neucha.ttf', # 'https://cdn.statically.io/gh/google/fonts/main/ofl/catamaran/Catamaran%5Bwght%5D.ttf', # font_base_url + 'lobstertwo.ttf', # font_base_url + 'underdog.ttf', # font_base_url + 'specialelite.ttf', # font_base_url + 'abrilfatface.ttf', # font_base_url + 'merienda.ttf', # font_base_url + 'poiretone.ttf', # font_base_url + 'shadowsintolight.ttf', # font_base_url + 'caveatbrush.ttf', # font_base_url + 'gochihand.ttf', # font_base_url + 'itim.ttf', # font_base_url + 'rancho.ttf' ] # thanks to https://clrs.cc COLORS = [ {'bg': (255, 255, 255), 'fg': (100, 100, 100)} # { 'bg': (0, 31, 63), 'fg': (128, 191, 255) }, # { 'bg': (0, 116, 217), 'fg': (179, 219, 255) }, # { 'bg': (127, 219, 255), 'fg': (0, 73, 102) }, # { 'bg': (57, 204, 204), 'fg': (0, 0, 0) }, # { 'bg': (61, 153, 112), 'fg': (22, 55, 40) }, # { 'bg': (46, 204, 64), 'fg': (14, 62, 20) }, # { 'bg': (1, 255, 112), 'fg': (0, 102, 44) }, # { 'bg': (255, 220, 0), 'fg': (102, 88, 0) }, # { 'bg': (255, 133, 27), 'fg': (102, 48, 0) }, # { 'bg': (255, 65, 54), 'fg': (128, 6, 0) }, # { 'bg': (133, 20, 75), 'fg': (235, 122, 177) }, # { 'bg': (240, 18, 190), 'fg': (101, 6, 79) }, # { 'bg': (177, 13, 201), 'fg': (239, 169, 249) }, # { 'bg': (17, 17, 17), 'fg': (221, 221, 221) }, # { 'bg': (170, 170, 170), 'fg': (0, 0, 0) }, # { 'bg': (221, 221, 221), 'fg': (0, 0, 0) } ]
33.956522
93
0.560051
88bea4fa9c19bdca4e8c6da218e8d49f1310845f
240
py
Python
api_ui/views.py
mihail-ivanov/base-vue-api
a2ef8ae360d3d26425093aefaf521082cf3684c5
[ "MIT" ]
null
null
null
api_ui/views.py
mihail-ivanov/base-vue-api
a2ef8ae360d3d26425093aefaf521082cf3684c5
[ "MIT" ]
null
null
null
api_ui/views.py
mihail-ivanov/base-vue-api
a2ef8ae360d3d26425093aefaf521082cf3684c5
[ "MIT" ]
null
null
null
from django.contrib.auth.models import User from rest_framework import generics from .serializers import UserSerializer
21.818182
43
0.808333
88beff2251e1c3db657b53d33c4f8b3982f9a861
5,093
py
Python
metashade/hlsl/sm5/profile.py
ppenenko/metashade
7148e808e47bace59e61e1483da9ddf3f9daa1cc
[ "Apache-2.0" ]
3
2020-04-02T13:29:06.000Z
2020-09-07T17:43:09.000Z
metashade/hlsl/sm5/profile.py
ppenenko/metashade
7148e808e47bace59e61e1483da9ddf3f9daa1cc
[ "Apache-2.0" ]
null
null
null
metashade/hlsl/sm5/profile.py
ppenenko/metashade
7148e808e47bace59e61e1483da9ddf3f9daa1cc
[ "Apache-2.0" ]
null
null
null
# Copyright 2017 Pavlo Penenko # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import metashade.rtsl.profile as rtsl import metashade.clike.struct as struct from . import data_types from . import samplers import sys, inspect # Reference all the data types from the generator class for name, cls in inspect.getmembers( sys.modules[data_types.__name__], lambda member: (inspect.isclass(member) and member.__module__ == data_types.__name__ and not member.__name__.startswith('_') )): setattr(Generator, name, cls)
34.181208
79
0.634204
88beffc16b35e904c09d6505bf831f2d157a3465
1,981
py
Python
ads_refine/create_refine_project.py
adsabs/refine-affiliations
b51290221d22400fa8fee6d5dac98c4930fbd7f3
[ "OLDAP-2.6", "Python-2.0" ]
1
2015-02-06T05:44:26.000Z
2015-02-06T05:44:26.000Z
ads_refine/create_refine_project.py
adsabs/refine-affiliations
b51290221d22400fa8fee6d5dac98c4930fbd7f3
[ "OLDAP-2.6", "Python-2.0" ]
null
null
null
ads_refine/create_refine_project.py
adsabs/refine-affiliations
b51290221d22400fa8fee6d5dac98c4930fbd7f3
[ "OLDAP-2.6", "Python-2.0" ]
null
null
null
#!/usr/bin/python2.6 import os import sys import time from optparse import OptionParser from google.refine import refine from clean_ads_affiliations import clean_ads_affs assert sys.hexversion >= 0x02060000 SERVER = 'http://adsx.cfa.harvard.edu:3333' def create_refine_project(path, name, pretend=False, verbose=0): """ Creates a project in google Refine and loads the affiliations. """ input_file = os.path.abspath(path) msg('Create a file that we can upload to Refine.', verbose) new_input_file = clean_ads_affs(input_file, verbose) msg('Upload to Refine.', verbose) project_name = 'Astronomy affiliations (%s) (created %s)' % (os.path.basename(path).replace('.reversed', '.merged'), time.asctime()) print 'Creating project "%s".' % project_name if not pretend: r = refine.Refine(SERVER) project = r.new_project(project_file=new_input_file, project_name=project_name, split_into_columns=True, separator='\t', ignore_initial_non_blank_lines=0, header_lines=1, skip_initial_data_rows=0, limit=0, guess_value_type=False, ignore_quotes=False) msg('Done with success.', verbose) return project.project_id if __name__ == '__main__': main()
31.951613
136
0.648662
88c000e9e02c415df05d77f3582eae21f519869a
8,256
py
Python
backend/views.py
johnzhang1999/Pop
284cc1c5195efdc676759d8494965b2dfb44cf78
[ "MIT" ]
1
2019-02-10T06:50:25.000Z
2019-02-10T06:50:25.000Z
backend/views.py
johnzhang1999/Pop
284cc1c5195efdc676759d8494965b2dfb44cf78
[ "MIT" ]
null
null
null
backend/views.py
johnzhang1999/Pop
284cc1c5195efdc676759d8494965b2dfb44cf78
[ "MIT" ]
null
null
null
from django.http import JsonResponse, Http404 from django.views.decorators.csrf import csrf_exempt from exponent_server_sdk import PushClient, PushMessage, DeviceNotRegisteredError from .models import Group, User, Event import hashlib, uuid # Create your views here.
38.222222
128
0.56468
88c03f34e857962f5d9b4b18e80b0b7a54e0e36b
3,572
py
Python
SDFConv/code/utils/vis/unet_vis.py
zshyang/FieldConvolution
ca88df568a6f2143dcb85d22c005fce4562a7523
[ "MIT" ]
1
2021-01-03T18:53:06.000Z
2021-01-03T18:53:06.000Z
SDFConv/code/utils/vis/unet_vis.py
zshyang/FieldConvolution
ca88df568a6f2143dcb85d22c005fce4562a7523
[ "MIT" ]
null
null
null
SDFConv/code/utils/vis/unet_vis.py
zshyang/FieldConvolution
ca88df568a6f2143dcb85d22c005fce4562a7523
[ "MIT" ]
null
null
null
"""Implement this function across different project. ----ZY.2020.Oct. """ import os from easydict import EasyDict from torchvision.utils import save_image from logging import Logger from subprocess import call def create_save_folders(root_folder, folder_list: list): """Create folders to save visualization image. :param root_folder: The root folder. :param folder_list: The list of folders """ for folder in folder_list: os.makedirs(os.path.join(root_folder, folder), exist_ok=True) def unet_vis( in_batch: dict, out_batch: tuple, training: bool, epoch: int, step: int, options: EasyDict, logger: Logger ): """The visualization function of UNet. :param in_batch: The input batch. :param out_batch: The output batch. :param training: Whether it is training stage. :param epoch: The epoch number start with 1. :param step: The step. :param logger: The logger. :param options: The options for visualization. """ # Folders if training: vis_dir = os.path.join(options.vis.dir, "train_vis") else: vis_dir = os.path.join(options.vis.dir, "val_vis") out_dir = os.path.join(vis_dir, "epoch-{:04d}".format(epoch)) # Customize the list of folders. dir_list = ["input_image", "info"] # Create the list folders. create_save_folders(out_dir, dir_list) # The list of key in input and output batch. key_list = ["input_image", ["loss"]] batch = {} batch.update(in_batch) batch.update(out_batch[0]) batch.update(out_batch[1]) # Get the batch size. if training: batch_size = options.train.batch_size else: batch_size = options.test.batch_size # Get number of steps each epoch. if training: # Update the number of training samples in options. num_step_each_epoch = options.dataset.len_train // (options.train.batch_size * options.num_gpus) else: # Update the number of validation samples in options. num_step_each_epoch = options.dataset.len_test // (options.test.batch_size * options.num_gpus) # Save images and info. for i in range(batch_size): batch_id = step % num_step_each_epoch fn = "data-{:04d}.png".format(batch_id * batch_size + i) # file name. for key, folder in zip(key_list, dir_list): if folder == "info": with open(os.path.join(out_dir, folder, fn.replace('.png', '.txt')), 'w') as file: for loss_item in key: file.write("{}: {}\n".format(loss_item, batch[loss_item][i].item())) else: save_image(batch[key][i], os.path.join(out_dir, folder, fn)) # Get the KC step interval. if training: kc_steps = options.train.kc_steps else: kc_steps = options.test.kc_steps # Generate HTML file. mod_step = step % num_step_each_epoch # step starts ar 1. extra_step = (mod_step + kc_steps) / num_step_each_epoch if mod_step == 0 or extra_step > 1.0: # Visualize HTML. logger.info("Generating html visualization ...") sublist = ",".join(dir_list) script_path = os.path.join(os.path.abspath(os.getcwd()), "utils", "gen_html_hierarchy_local.py") if not os.path.exists(script_path): raise ValueError("{} this python script does not exist!".format(script_path)) cmd = "cd {} && python {} . 10 htmls {} {} > /dev/null".format( out_dir, script_path, sublist, sublist ) call(cmd, shell=True) logger.info("DONE")
37.208333
114
0.645017
88c151ffa4679f358142c0fae2020059a35ad3a9
1,465
py
Python
tests/test_models/test_metric_report.py
wikimedia/analytics-wikimetrics
1d2036657b06ccd16ecfc76edd3f9a6119ff75f4
[ "MIT" ]
6
2015-01-28T05:59:08.000Z
2018-01-09T07:48:57.000Z
tests/test_models/test_metric_report.py
wikimedia/analytics-wikimetrics
1d2036657b06ccd16ecfc76edd3f9a6119ff75f4
[ "MIT" ]
2
2020-05-09T16:36:43.000Z
2020-05-09T16:52:35.000Z
tests/test_models/test_metric_report.py
wikimedia/analytics-wikimetrics
1d2036657b06ccd16ecfc76edd3f9a6119ff75f4
[ "MIT" ]
1
2016-01-13T07:19:44.000Z
2016-01-13T07:19:44.000Z
from nose.tools import assert_equals, assert_true from wikimetrics.metrics import metric_classes from wikimetrics.models import ( MetricReport ) from ..fixtures import DatabaseTest
28.173077
57
0.524915
88c2edc9c66f0cdca479957d50dd7215d509131a
615
py
Python
setup.py
manu-mannattil/clut2dtstyle
4d4cbea540de9f3b3bde209fbe1f8696e441492d
[ "Unlicense" ]
9
2018-09-13T04:27:23.000Z
2022-01-02T23:34:20.000Z
setup.py
manu-mannattil/clut2dtstyle
4d4cbea540de9f3b3bde209fbe1f8696e441492d
[ "Unlicense" ]
null
null
null
setup.py
manu-mannattil/clut2dtstyle
4d4cbea540de9f3b3bde209fbe1f8696e441492d
[ "Unlicense" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup setup( name="clut2dtstyle", license="Unlicense", version="0.1", author="Manu Mannattil", author_email="manu.mannattil@gmail.com", description="Script to convert Hald CLUTs to darktable styles", py_modules=["clut2dtstyle"], install_requires=["numpy>=1.11.0"], classifiers=[ "License :: Public Domain", "Programming Language :: Python :: 3", "Topic :: Multimedia :: Graphics" ], entry_points=""" [console_scripts] clut2dtstyle=clut2dtstyle:main """ )
24.6
67
0.621138
88c3e3d167bb3169d56f9fd93e05df1be55709b1
1,903
py
Python
xugrid/data/synthetic.py
Deltares/xugrid
41881977e5e49d0f87a90dd995960283b812b921
[ "MIT" ]
15
2021-10-04T15:18:33.000Z
2022-03-14T13:58:27.000Z
xugrid/data/synthetic.py
Deltares/xugrid
41881977e5e49d0f87a90dd995960283b812b921
[ "MIT" ]
10
2021-11-10T15:12:02.000Z
2022-02-10T14:35:57.000Z
xugrid/data/synthetic.py
Deltares/xugrid
41881977e5e49d0f87a90dd995960283b812b921
[ "MIT" ]
null
null
null
import meshzoo import numpy as np import xarray as xr import xugrid def transform(vertices, minx, maxx, miny): """ Transform vertices to fit within minx to maxx. Maintains x:y aspect ratio. """ x, y = vertices.T xmin = x.min() xmax = x.max() ymin = y.min() ymax = y.max() dx = xmax - xmin dy = ymax - ymin new_dx = maxx - minx new_dy = dy / dx * new_dx x = (x - xmin) * new_dx / dx + minx y = (y - ymin) * new_dy / dy + miny return np.column_stack([x, y])
27.985294
105
0.527063
88c491334363ecfc6c68f1628bee0883ccd9f9e7
898
py
Python
calendar_generator/migrations/0006_resetday.py
rectory-school/rectory-apps-updated
a6d47f6d5928f0c816eb45fd229da2f9f2fa2ff1
[ "MIT" ]
null
null
null
calendar_generator/migrations/0006_resetday.py
rectory-school/rectory-apps-updated
a6d47f6d5928f0c816eb45fd229da2f9f2fa2ff1
[ "MIT" ]
30
2021-07-16T12:54:14.000Z
2021-12-24T16:59:04.000Z
calendar_generator/migrations/0006_resetday.py
rectory-school/rectory-apps-updated
a6d47f6d5928f0c816eb45fd229da2f9f2fa2ff1
[ "MIT" ]
null
null
null
# Generated by Django 3.2.5 on 2021-07-19 20:22 from django.db import migrations, models import django.db.models.deletion
33.259259
127
0.601336
88c4cf9f6f8d805d5af7d3c164350e7934f1fcde
2,492
py
Python
ckanext/tess/group.py
ElixirUK/ckanext-tess
01725ff81b74f31d906875cb0cf493e7d3533615
[ "BSD-3-Clause" ]
1
2015-05-18T08:31:28.000Z
2015-05-18T08:31:28.000Z
ckanext/tess/group.py
ElixirUK/ckanext-tess
01725ff81b74f31d906875cb0cf493e7d3533615
[ "BSD-3-Clause" ]
null
null
null
ckanext/tess/group.py
ElixirUK/ckanext-tess
01725ff81b74f31d906875cb0cf493e7d3533615
[ "BSD-3-Clause" ]
null
null
null
import ckan.plugins as plugins import ckan.model as model import ckan.logic as logic import ckan.plugins.toolkit as toolkit import ckan.lib.plugins as plugs from pylons import c NotFound = logic.NotFound get_action = logic.get_action
33.675676
123
0.656902
88c6dfcf5b1c5b830035587feb18704990928ca6
2,087
py
Python
package/spack-discovardenovo/package.py
ctuning/ck-spack
307934efce1be2d4f104251275c82fbc70127105
[ "BSD-3-Clause" ]
1
2018-07-17T07:45:09.000Z
2018-07-17T07:45:09.000Z
package/spack-discovardenovo/package.py
ctuning/ck-spack
307934efce1be2d4f104251275c82fbc70127105
[ "BSD-3-Clause" ]
null
null
null
package/spack-discovardenovo/package.py
ctuning/ck-spack
307934efce1be2d4f104251275c82fbc70127105
[ "BSD-3-Clause" ]
null
null
null
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-647188 # # For details, see https://github.com/spack/spack # Please also see the NOTICE and LICENSE files for our notice and the LGPL. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License (as # published by the Free Software Foundation) version 2.1, February 1999. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and # conditions of the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import *
45.369565
115
0.689506
88c7e5dd6da0bf02bd4f18142f4b9f76bc68b52c
10,379
py
Python
s2_convert.py
uscensusbureau/SABLE
883d449e4e6b75636d2589f540e86a5401e09932
[ "CC0-1.0" ]
27
2017-11-06T22:55:24.000Z
2021-06-11T12:56:03.000Z
s2_convert.py
uscensusbureau/SABLE
883d449e4e6b75636d2589f540e86a5401e09932
[ "CC0-1.0" ]
1
2018-01-31T18:26:23.000Z
2018-01-31T18:26:23.000Z
s2_convert.py
uscensusbureau/SABLE
883d449e4e6b75636d2589f540e86a5401e09932
[ "CC0-1.0" ]
8
2017-10-05T19:17:05.000Z
2020-10-21T23:08:34.000Z
#Name: s2_convert.py #Purpose: Convert PDFs to TXT format #Invocation: python3 s2_convert.py <projName> <lng> <clss> import codecs import os import re import sys #Name: valid_arguments #Purpose: Check whether the command-line arguments are valid #Parameters: sys.argv (globally defined list of command-line arguments) #Returns: True (arguments are valid) or False (arguments are invalid) #Name: match_page #Purpose: Match line to an XML page tag #Parameters: line (line of text from XML file) #Returns: Regular expression match object #Name: match_textbox #Purpose: Match line to an XML textbox tag #Parameters: line (line of text from XML file) #Returns: Regular expression match object #Name: match_textline #Purpose: Match line to an XML textline tag #Parameters: line (line of text from XML file) #Returns: Regular expression match object #Name: match_text #Purpose: Match line to an XML text tag #Parameters: line (line of text from XML file) #Returns: Regular expression match object #Name: clean_char #Purpose: Clean character to deal with punctuation, numbers, and foreign accent marks #Parameters: old (character) #Returns: Cleaned character #Name: get_chars #Purpose: Extract the character values, coordinates, hierarchy, and font information from XML file #Parameters: xmlFile (location of XML file) #Returns: List of tuples (one for each character) containing character data #Name: clean_text #Purpose: Clean string of text and check each word against a list of stop words #Parameters: text (string of text) #Returns: Cleaned text #Name: write_text #Purpose: Construct words character by character #Parameters: chars (list of tuples) # txtFile (location of TXT file) #Returns: #Name: create_output #Purpose: Convert a PDF document of a given class to TXT format #Parameters: projName (project name) # clss ("pos" or "neg") # docName (document name) #Returns: #Name: convert_files #Purpose: Convert PDFs to TXT format #Parameters: projName (project name) # lng (language) # clss ("neg", "pos", or "pred") #Returns: if __name__ == "__main__": main()
34.946128
169
0.544561
88cc5b4b5dc736d6b8f2e83c34762ada5532c58b
200
py
Python
sdata_experiments/tension_test.py
lepy/sdata_experiments
84aa32ec497639a30d4f71c7fa9e463cf2d8f037
[ "MIT" ]
1
2020-12-21T18:28:00.000Z
2020-12-21T18:28:00.000Z
sdata_experiments/tension_test.py
lepy/sdata_experiments
84aa32ec497639a30d4f71c7fa9e463cf2d8f037
[ "MIT" ]
null
null
null
sdata_experiments/tension_test.py
lepy/sdata_experiments
84aa32ec497639a30d4f71c7fa9e463cf2d8f037
[ "MIT" ]
null
null
null
# -*-coding: utf-8-*- from sdata.experiments import Test
22.222222
48
0.63
88cc892509c73d91def940743039ba5fd8a12e2f
5,818
py
Python
copy-net3_main0_1_2_20-01-10_14-12-14_epoch600_lr0-3_decay0-0_decay20-0_decay39e-05_seed0/main0.py
ninfueng/nsn
a214eafbcf5cf6dedb57131bc6eb1d307797f2ab
[ "MIT" ]
null
null
null
copy-net3_main0_1_2_20-01-10_14-12-14_epoch600_lr0-3_decay0-0_decay20-0_decay39e-05_seed0/main0.py
ninfueng/nsn
a214eafbcf5cf6dedb57131bc6eb1d307797f2ab
[ "MIT" ]
null
null
null
copy-net3_main0_1_2_20-01-10_14-12-14_epoch600_lr0-3_decay0-0_decay20-0_decay39e-05_seed0/main0.py
ninfueng/nsn
a214eafbcf5cf6dedb57131bc6eb1d307797f2ab
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """The code implementation of SharedGradNet. main0.py is for neural networks without hidden layer. Some part from: https://jhui.github.io/2018/02/09/PyTorch-Variables-functionals-and-Autograd/ 2019/06/17: Update with hyper-parameter tuning script. 2019/06/25: Committed main0.py. """ __author__ = 'Ninnart Fuengfusin' __version__ = '0.0.1' __email__ = 'ninnart.fuengfusin@yahoo.com' import os import time import logging import argparse import torch import torch.nn as nn import model from weight_decay import * from dataset import load_dataset from utils import * from recorder import Recorder from updater import UpdateMomentum from namer import namer parser = argparse.ArgumentParser(description='PyTorch implementation of SharedGradNet.') parser.add_argument('--epoch', '-e', type=int, default=600, help='Number of training epoch.') parser.add_argument('--learning_rate', '-lr', type=float, default=3e-1, help='A floating for initial learning rate.') parser.add_argument('--train_batch', type=int, default=128, help='A integer for train batch amount.') parser.add_argument('--test_batch', type=int, default=128, help='A integer for test batch amount') parser.add_argument('--num_neuron', type=int, default=784, help='Number of neurons in fully connected layer for produce codes') parser.add_argument('--weight_decay', type=float, default=0, help='A floating for weight decay.') parser.add_argument('--load', type=str2bool, default=False, help='A boolean for loading weights from load_location or not.') parser.add_argument('--load_location', type=str, default='model1-baseline', help='A string of location for loading weights.') parser.add_argument('--seed', '-s', type=int, default=0, help='An integer for initialization randomness.') args = parser.parse_args() if __name__ == '__main__': save_loc = namer( f'epoch{args.epoch}', f'lr{args.learning_rate}', f'decay{args.weight_decay}', f'seed{args.seed}') set_logger(os.path.join(os.getcwd(), save_loc), 'info.log') logging.info(__doc__) logging.info(args) set_printoptions() seed_everywhere_torch(args.seed) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') record = Recorder('test_acc', 'test_acc2', 'test_acc3', 'test_loss', 'test_loss2', 'test_loss3') train_loader, test_loader, img_size = load_dataset( num_train_batch=args.train_batch, num_test_batch=args.test_batch, num_extra_batch=0, num_worker=8, dataset='mnist') model1 = model.NetworkWithSub1() updaterW1_1 = UpdateMomentum() updaterB1_1 = UpdateMomentum() model1.to(device) BETA = 0.9 t1 = time.time() for i in range(args.epoch): # Accumulating variables. total_train_loss = 0 train_correct = 0 train_total = 0 total_test_loss = 0 test_correct = 0 test_total = 0 model1.train() args.learning_rate = args.learning_rate/3 if i % 200 == 0 and i != 0 else args.learning_rate for train_data, train_label in train_loader: model1.zero_grad() train_data, train_label = train_data.to(device), train_label.to(device) train_output = model1.forward(train_data) train_loss = nn.CrossEntropyLoss()( train_output, train_label) #+ l2_weight_decay(args.weight_decay2, model2.w1) train_loss.backward() total_train_loss += train_loss.item() _, train_predicted = torch.max(train_output.data, 1) train_correct += (train_predicted == train_label).sum().item() train_total += train_label.data.size(0) model1.w1.data = updaterW1_1.update( model1.w1.data, BETA, args.learning_rate, model1.w1.grad.data) model1.b1.data = updaterB1_1.update( model1.b1.data, BETA, args.learning_rate, model1.b1.grad.data) logging.info(f'Epoch: {i + 1}') logging.info(f'Train Accuracy: {train_correct/train_total}, \nLoss: {total_train_loss/train_total}') with torch.no_grad(): model1.eval() for test_data, test_label in test_loader: test_data, test_label = test_data.to(device), test_label.to(device) test_output = model1.forward(test_data) test_loss = nn.CrossEntropyLoss()(test_output, test_label) total_test_loss += test_loss.item() _, test_predicted = torch.max(test_output.data, 1) test_correct += (test_predicted == test_label).sum().item() test_total += test_label.data.size(0) if record.more_than_highest('test_acc', test_correct/test_total): save_model(model1, os.path.join(os.getcwd(), save_loc, 'checkpoint.pth')) logging.info(f'Save model') t2 = time.time() - t1 logging.info(f'Test Accuracy: {test_correct/test_total}, \nLoss: {total_test_loss/test_total}') record.record('test_acc', test_correct/test_total) logging.info(f'Learning rate {args.learning_rate}') logging.info(f'Timer: {to_hhmmss(t2)}') logging.info(f'=====================================================================================') record.save_all(os.path.join(os.getcwd(), save_loc)) logging.info(f'best test_acc: {record.highest("test_acc")}') logging.info(f'model1:w1 = {model1.w1.data}') record.plot( 'test_acc', save=True, save_loc=os.path.join(os.getcwd(), save_loc, 'test_acc.png')) np.savetxt( os.path.join(os.getcwd(), save_loc, f'{record.highest("test_acc")}.txt'), record.highest("test_acc"), delimiter=',')
46.174603
117
0.653489
88cc9bf2217df7c1469f0332dd2da660bb7b852c
19,144
py
Python
src/win/efuseWin_BootCfg2.py
KKKelvin7/NXP-MCUBootUtility
b4cded82aa9d20c2cb718f60493d1226fc999b43
[ "Apache-2.0" ]
null
null
null
src/win/efuseWin_BootCfg2.py
KKKelvin7/NXP-MCUBootUtility
b4cded82aa9d20c2cb718f60493d1226fc999b43
[ "Apache-2.0" ]
null
null
null
src/win/efuseWin_BootCfg2.py
KKKelvin7/NXP-MCUBootUtility
b4cded82aa9d20c2cb718f60493d1226fc999b43
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Aug 8 2018) ## http://www.wxformbuilder.org/ ## ## PLEASE DO *NOT* EDIT THIS FILE! ########################################################################### import wx import wx.xrc ########################################################################### ## Class efuseWin_BootCfg2 ###########################################################################
48.465823
190
0.729994
88cd7b4748dfc9d48b07e74cd1faaed730733d74
55
py
Python
python.py
Ayesha-Anjum-639/assignment
5a57fdfd360467d540cf12fe0f842ddd458371b8
[ "MIT" ]
1
2019-10-12T17:28:12.000Z
2019-10-12T17:28:12.000Z
python.py
Ayesha-Anjum-639/assignment
5a57fdfd360467d540cf12fe0f842ddd458371b8
[ "MIT" ]
null
null
null
python.py
Ayesha-Anjum-639/assignment
5a57fdfd360467d540cf12fe0f842ddd458371b8
[ "MIT" ]
null
null
null
print("Hello World") print(5+4) print(5,"+",4,"=",5+4)
13.75
22
0.563636
88cd952c28db68aa348176e890db4ed64336fc66
332
py
Python
hud_api_replace/management/commands/delete_expired_geodata.py
Ooblioob/django-hud
66aac9f182f8c68a380dc36ade46d7e0df30bf24
[ "CC0-1.0" ]
10
2015-01-05T21:13:07.000Z
2017-05-28T04:08:15.000Z
hud_api_replace/management/commands/delete_expired_geodata.py
Ooblioob/django-hud
66aac9f182f8c68a380dc36ade46d7e0df30bf24
[ "CC0-1.0" ]
15
2015-01-29T02:08:39.000Z
2018-01-17T13:24:50.000Z
hud_api_replace/management/commands/delete_expired_geodata.py
Ooblioob/django-hud
66aac9f182f8c68a380dc36ade46d7e0df30bf24
[ "CC0-1.0" ]
34
2015-01-26T19:34:47.000Z
2021-02-20T10:55:22.000Z
from django.core.management.base import BaseCommand, CommandError import time from hud_api_replace.models import CachedGeodata
27.666667
77
0.759036
88cfb3f12d8dd1b1dd5417858d82ba8a891b227e
7,694
py
Python
etc/dbus-serialbattery/battery.py
Carstijn/dbus-serialbattery
23afec33c2fd87fd4d4c53516f0a25f290643c82
[ "MIT" ]
null
null
null
etc/dbus-serialbattery/battery.py
Carstijn/dbus-serialbattery
23afec33c2fd87fd4d4c53516f0a25f290643c82
[ "MIT" ]
null
null
null
etc/dbus-serialbattery/battery.py
Carstijn/dbus-serialbattery
23afec33c2fd87fd4d4c53516f0a25f290643c82
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import utils
35.786047
101
0.618144
88d2d07a327a91f5956c30f18f5820061fc0b593
16,227
py
Python
lumicks/pylake/kymotracker/detail/binding_times.py
lumicks/pylake
b5875d156d6416793a371198f3f2590fca2be4cd
[ "Apache-2.0" ]
8
2019-02-18T07:56:39.000Z
2022-03-19T01:14:48.000Z
lumicks/pylake/kymotracker/detail/binding_times.py
lumicks/pylake
b5875d156d6416793a371198f3f2590fca2be4cd
[ "Apache-2.0" ]
42
2018-11-30T14:40:35.000Z
2022-03-29T11:43:45.000Z
lumicks/pylake/kymotracker/detail/binding_times.py
lumicks/pylake
b5875d156d6416793a371198f3f2590fca2be4cd
[ "Apache-2.0" ]
4
2019-01-09T13:45:53.000Z
2021-07-06T14:06:52.000Z
import numpy as np from scipy.special import logsumexp from scipy.optimize import minimize from functools import partial from dataclasses import dataclass, field import matplotlib.pyplot as plt def exponential_mixture_log_likelihood_components( amplitudes, lifetimes, t, min_observation_time, max_observation_time ): """Calculate each component of the log likelihood of an exponential mixture distribution. The full log likelihood for a single observation is given by: log(L) = log( sum_i( component_i ) ) with the output of this function being log(component_i) defined as: log(component_i) = log(a_i) - log(N) + log(tau_i) - t/tau_i where a_i and tau_i are the amplitude and lifetime of component i and N is a normalization factor that takes into account the minimum and maximum observation times of the experiment: N = sum_i { a_i * [ exp(-t_min / tau_i) - exp(-t_max / tau_i) ] } Therefore, the full log likelihood is calculated from the output of this function by applying logsumexp(output, axis=0) where the summation is taken over the components. Parameters ---------- amplitudes : array_like fractional amplitude parameters for each component lifetimes : array_like lifetime parameters for each component in seconds t : array_like dwelltime observations in seconds min_observation_time : float minimum observation time in seconds max_observation_time : float maximum observation time in seconds """ amplitudes = amplitudes[:, np.newaxis] lifetimes = lifetimes[:, np.newaxis] t = t[np.newaxis, :] norm_factor = np.log(amplitudes) + np.log( np.exp(-min_observation_time / lifetimes) - np.exp(-max_observation_time / lifetimes) ) log_norm_factor = logsumexp(norm_factor, axis=0) return -log_norm_factor + np.log(amplitudes) - np.log(lifetimes) - t / lifetimes def exponential_mixture_log_likelihood(params, t, min_observation_time, max_observation_time): """Calculate the log likelihood of an exponential mixture distribution. The full log likelihood for a single observation is given by: log(L) = log( sum_i( exp( log(component_i) ) ) ) where log(component_i) is output from `exponential_mixture_log_likelihood_components()` Parameters ---------- amplitudes : array_like fractional amplitude parameters for each component lifetimes : array_like lifetime parameters for each component in seconds t : array_like dwelltime observations in seconds min_observation_time : float minimum observation time in seconds max_observation_time : float maximum observation time in seconds """ params = np.reshape(params, (2, -1)) components = exponential_mixture_log_likelihood_components( params[0], params[1], t, min_observation_time, max_observation_time ) log_likelihood = logsumexp(components, axis=0) return -np.sum(log_likelihood) def _kinetic_mle_optimize( n_components, t, min_observation_time, max_observation_time, initial_guess=None ): """Calculate the maximum likelihood estimate of the model parameters given measured dwelltimes. Parameters ---------- n_components : int number of components in the mixture model t : array_like dwelltime observations in seconds min_observation_time : float minimum observation time in seconds max_observation_time : float maximum observation time in seconds initial_guess : array_like initial guess for the model parameters ordered as [amplitude1, amplitude2, ..., lifetime1, lifetime2, ...] """ if np.any(np.logical_or(t < min_observation_time, t > max_observation_time)): raise ValueError( "some data is outside of the bounded region. Please choose" "appropriate values for `min_observation_time` and/or `max_observation_time`." ) cost_fun = partial( exponential_mixture_log_likelihood, t=t, min_observation_time=min_observation_time, max_observation_time=max_observation_time, ) if initial_guess is None: initial_guess_amplitudes = np.ones(n_components) / n_components initial_guess_lifetimes = np.mean(t) * np.arange(1, n_components + 1) initial_guess = np.hstack([initial_guess_amplitudes, initial_guess_lifetimes]) bounds = ( *[(np.finfo(float).eps, 1) for _ in range(n_components)], *[(min_observation_time * 0.1, max_observation_time * 1.1) for _ in range(n_components)], ) constraints = {"type": "eq", "fun": lambda x, n: 1 - sum(x[:n]), "args": [n_components]} result = minimize( cost_fun, initial_guess, method="SLSQP", bounds=bounds, constraints=constraints ) return BindingDwelltimes( n_components, t, (min_observation_time, max_observation_time), result.x, -result.fun )
38.913669
101
0.638442
88d4df17e09f04b37643b41464da40650a4a1467
302
py
Python
ExPython/CursoemVideo/ex011.py
MatheusEwen/Exercicios_Do_CursoDePython
7c21f95f0d31ec1e6c17e1b957c1442843118c48
[ "MIT" ]
1
2020-10-06T00:27:05.000Z
2020-10-06T00:27:05.000Z
ExPython/CursoemVideo/ex011.py
MatheusEwen/Exercicios_Do_CursoDePython
7c21f95f0d31ec1e6c17e1b957c1442843118c48
[ "MIT" ]
null
null
null
ExPython/CursoemVideo/ex011.py
MatheusEwen/Exercicios_Do_CursoDePython
7c21f95f0d31ec1e6c17e1b957c1442843118c48
[ "MIT" ]
null
null
null
largura=float(input('digite qual a largura da sua parede:')) comprimento=float(input('digite qual o comprimento da sua parede:')) quantidade=((largura*comprimento)/2) print('A area da sua parede de',(largura*comprimento),'para pintar sua parede ser necessario {} litros de tinta'.format(quantidade))
75.5
135
0.771523
88da52cb71a753a4cfdc782a27d2b76618927365
2,821
py
Python
build/fbcode_builder_config.py
YangKian/LogDevice
e5c2168c11e9de867a1bcf519f95016e1c879b5c
[ "BSD-3-Clause" ]
1,831
2018-09-12T15:41:52.000Z
2022-01-05T02:38:03.000Z
build/fbcode_builder_config.py
YangKian/LogDevice
e5c2168c11e9de867a1bcf519f95016e1c879b5c
[ "BSD-3-Clause" ]
183
2018-09-12T16:14:59.000Z
2021-12-07T15:49:43.000Z
build/fbcode_builder_config.py
YangKian/LogDevice
e5c2168c11e9de867a1bcf519f95016e1c879b5c
[ "BSD-3-Clause" ]
228
2018-09-12T15:41:51.000Z
2022-01-05T08:12:09.000Z
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import, division, print_function, unicode_literals import specs.fizz as fizz import specs.fmt as fmt import specs.folly as folly import specs.sodium as sodium import specs.wangle as wangle import specs.zstd as zstd from shell_quoting import ShellQuoted "fbcode_builder steps to build & test LogDevice" """ Running this script from the command line on a dev-server: 1. Ensure you have the HTTP proxy configured in environment 2. This is env items is not compatible with the scutil create call, so must not be permenently exported. git config --global http.proxy http://fwdproxy:8080 cd .../fbcode/logdevice/public_tld/build HTTP_PROXY=http://fwdproxy:8080 HTTPS_PROXY=http://fwdproxy:8080 \ fbcode/opensource/fbcode_builder/facebook_make_legocastle_job.py \ | scutil create Which outputs a legocastle job to stdout; to be fed into scutil create ... """ config = { "github_project": "facebookincubator/LogDevice", "fbcode_builder_spec": fbcode_builder_spec, }
31.344444
87
0.684864
88da8643ac576a43d9d46ba217a9282045a5ba68
3,040
py
Python
setup.py
ikalnytskyi/em
3e7c20c16814bed86409212e0a2a9fee49398994
[ "BSD-3-Clause" ]
null
null
null
setup.py
ikalnytskyi/em
3e7c20c16814bed86409212e0a2a9fee49398994
[ "BSD-3-Clause" ]
1
2018-10-18T17:49:13.000Z
2018-10-18T17:49:13.000Z
setup.py
ikalnytskyi/em
3e7c20c16814bed86409212e0a2a9fee49398994
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 """ Em -- Em is a terminal tool that prints FILE(s), or standard input to standard output and highlights the expressions that are matched the PATTERN. The expression will be highlighted iff the terminal is ANSI-compatible. Em is Cool `````````` .. code:: bash $ tail -f /path/to/log | em "DEBUG|INFO" -f green | em "WARN" Links ````` * `documentation <http://em.readthedocs.org/>`_ * `source code <https://github.com/ikalnitsky/em>`_ """ import os import glob import subprocess from setuptools import setup, Command install_requires = [] try: import argparse # NOQA except ImportError: install_requires.append('argparse') setup( name='em', version='0.4.0', url='https://github.com/ikalnitsky/em', license='BSD', author='Igor Kalnitsky', author_email='igor@kalnitsky.org', description="Highlight some PATTERN in terminal's STDOUT", long_description=__doc__, include_package_data=True, packages=[ 'em', 'em.tests', ], install_requires=install_requires, test_suite='em.tests', entry_points={ 'console_scripts': ['em = em:main'], }, classifiers=[ 'Topic :: Utilities', 'Environment :: Console', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'License :: OSI Approved :: BSD License', ], platforms=['Linux', 'MacOS', 'Unix'], # add custom commands to manage locale files cmdclass={ 'locale_update': LocaleUpdate, 'locale_compile': LocaleCompile, }, )
23.937008
78
0.593421
88dac5f28a975211597a7acd699981246fdfddd1
1,883
py
Python
Python-Programs/Discord-bot-Motivation Bot/main.py
adityaverma121/Simple-Programs
8450560b97f89e0fa3da16a623ad35c0b26409c9
[ "MIT" ]
71
2021-09-30T11:25:12.000Z
2021-10-03T11:33:22.000Z
Python-Programs/Discord-bot-Motivation Bot/main.py
adityaverma121/Simple-Programs
8450560b97f89e0fa3da16a623ad35c0b26409c9
[ "MIT" ]
186
2021-09-30T12:25:16.000Z
2021-10-03T13:45:04.000Z
Python-Programs/Discord-bot-Motivation Bot/main.py
adityaverma121/Simple-Programs
8450560b97f89e0fa3da16a623ad35c0b26409c9
[ "MIT" ]
385
2021-09-30T11:34:23.000Z
2021-10-03T13:41:00.000Z
import json import os import random import string import requests from keep_alive import keep_alive from nltk.sentiment.vader import SentimentIntensityAnalyzer import discord client = discord.Client() starter_motivator = [ "Cheer Up!", "Always remember, I am here for you!", "You are a great person. Remember this!", "Think positive man! There is always a bright side!", "What about you watching a funny video to swing the mood?", ] keep_alive() client.run(os.environ["TOKEN"])
25.445946
153
0.630377
88debece08c1e96c24b4f8a33cbf44d5d6611a9b
1,655
py
Python
Malaria-Cell-Analyzer/mysite/core/gen_dataset_completed.py
suryabranwal/Malaria-Cell-Analyzer
eadbad1e0b5a51eeeb43fa75367d8b4d9eabe033
[ "MIT" ]
1
2019-12-20T18:04:40.000Z
2019-12-20T18:04:40.000Z
Malaria-Cell-Analyzer/mysite/core/gen_dataset_completed.py
suryabranwal/Malaria-Cell-Analyzer
eadbad1e0b5a51eeeb43fa75367d8b4d9eabe033
[ "MIT" ]
null
null
null
Malaria-Cell-Analyzer/mysite/core/gen_dataset_completed.py
suryabranwal/Malaria-Cell-Analyzer
eadbad1e0b5a51eeeb43fa75367d8b4d9eabe033
[ "MIT" ]
1
2019-11-26T14:06:03.000Z
2019-11-26T14:06:03.000Z
import cv2, os import numpy as np import csv import glob label = "Parasitized" dirList = glob.glob("cell_images/" + label + "/*.png") file = open("csv/dataset.csv", "a") for img_path in dirList: im = cv2.imread(img_path) im = cv2.GaussianBlur(im, (5, 5), 2) im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(im_gray, 127, 255, 0) contours, _ = cv2.findContours(thresh, 1, 2) for contour in contours: cv2.drawContours(im_gray, contours, -1, (0, 255, 0), 3) #cv2.imshow("window", im_gray) #break file.write(label) file.write(",") for i in range(5): try: area = cv2.contourArea(contours[i]) file.write(str(area)) except: file.write("0") file.write(",") file.write("\n") cv2.waitKey(19000) label = "Uninfected" dirList = glob.glob("cell_images/" + label + "/*.png") file = open("csv/dataset.csv", "a") for img_path in dirList: im = cv2.imread(img_path) im = cv2.GaussianBlur(im, (5, 5), 2) im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(im_gray, 127, 255, 0) contours, _ = cv2.findContours(thresh, 1, 2) for contour in contours: cv2.drawContours(im_gray, contours, -1, (0, 255, 0), 3) #cv2.imshow("window", im_gray) #break file.write(label) file.write(",") for i in range(5): try: area = cv2.contourArea(contours[i]) file.write(str(area)) except: file.write("0") if i != 4: file.write(",") file.write("\n") cv2.waitKey(19000)
18.388889
63
0.575227
88df26756f4d2511b8925b4ee5ec1ed8cec09d0b
1,234
py
Python
utils.py
wangke0809/learn-statistical-learning-method
10772659ff52ef64e7ff36dd3b701615e58de335
[ "MIT" ]
null
null
null
utils.py
wangke0809/learn-statistical-learning-method
10772659ff52ef64e7ff36dd3b701615e58de335
[ "MIT" ]
null
null
null
utils.py
wangke0809/learn-statistical-learning-method
10772659ff52ef64e7ff36dd3b701615e58de335
[ "MIT" ]
null
null
null
import os import numpy as np
29.380952
63
0.638574
88df286145e7e147b9e1130f9bc8b72465b90272
180
py
Python
mysite/iic/views.py
sandeepkeshav/iicj
c457fec176918af500699c8607f1d8cfc7543f1d
[ "MIT" ]
1
2020-11-25T17:02:25.000Z
2020-11-25T17:02:25.000Z
mysite/iic/views.py
sandeepkeshav/iicj
c457fec176918af500699c8607f1d8cfc7543f1d
[ "MIT" ]
null
null
null
mysite/iic/views.py
sandeepkeshav/iicj
c457fec176918af500699c8607f1d8cfc7543f1d
[ "MIT" ]
1
2020-11-25T17:01:33.000Z
2020-11-25T17:01:33.000Z
from __future__ import unicode_literals from django.shortcuts import render from django.http import HttpResponse
25.714286
43
0.811111
88e15f87d60572f7354fdd0f31ccffeddc289a42
2,210
py
Python
src/analysis.py
aliFrancis/mars-crater-catalogue
5e6ac4e1f7967b1d37d95e436edaa31ef2f2ed55
[ "CC-BY-4.0" ]
null
null
null
src/analysis.py
aliFrancis/mars-crater-catalogue
5e6ac4e1f7967b1d37d95e436edaa31ef2f2ed55
[ "CC-BY-4.0" ]
null
null
null
src/analysis.py
aliFrancis/mars-crater-catalogue
5e6ac4e1f7967b1d37d95e436edaa31ef2f2ed55
[ "CC-BY-4.0" ]
null
null
null
import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sn from utils import convert, iou if __name__ == '__main__': import os import sys survey_dir = sys.argv[1] paths = [os.path.join(survey_dir,path) for path in os.listdir(survey_dir)] surveys = [convert.xml2df(p) for p in paths] print('\nANALYSIS OF {}'.format(os.path.basename(survey_dir)),'\n') print(' NO. OF ANNOTATIONS') print(' ------------------') for survey,path in zip(surveys,paths): print(' ',os.path.basename(path).replace('.xml','')+':',len(survey)) total_survey = convert.dfs2df(surveys) print(' ____________') print(' TOTAL :',len(total_survey)) print('\n') group_binary_IOUs, group_IOUs = group_IOU_matrices(paths) print(' MEAN IoU') print(' --------') for i,path in enumerate(paths): print(' ',os.path.basename(path).replace('.xml','')+':',np.round(group_IOUs[i],4)) print(' ____________') print(' MEAN :',np.round(np.mean(group_IOUs),4)) print('\n') print('\n MEAN BINARY IoU (IoU treated as 1 if above 0.5)') print(' -----------------------------------------------') for i,path in enumerate(paths): print(' ',os.path.basename(path).replace('.xml','')+':',np.round(group_binary_IOUs[i],4)) print(' ____________') print(' MEAN :',np.round(np.mean(group_binary_IOUs),4)) print('\n')
34.53125
97
0.608597
88e195f25d51cac398d0cfdc139ce3c46cd5aeca
257
py
Python
prototype/zlua_prototype/tests/test_debugger.py
Zolo-mario/ZoloLua
7527a78b12c3f97cb729327d4d0c724f3dba17f9
[ "MIT" ]
9
2019-03-11T04:43:03.000Z
2019-05-12T08:33:31.000Z
prototype/zlua_prototype/tests/test_debugger.py
zoloypzuo/ZeloLua
7527a78b12c3f97cb729327d4d0c724f3dba17f9
[ "MIT" ]
2
2019-04-10T05:20:45.000Z
2019-06-02T13:56:39.000Z
prototype/zlua_prototype/tests/test_debugger.py
Zolo-mario/zlua
7527a78b12c3f97cb729327d4d0c724f3dba17f9
[ "MIT" ]
1
2021-12-29T03:13:49.000Z
2021-12-29T03:13:49.000Z
from unittest import TestCase
25.7
56
0.657588
88e45fe24cb4ac33e12b90a494c738b76fd18630
3,033
py
Python
scripts/test_tensorflow_spectrogram.py
RichardLitt/Vesper
5360844f42a06942e7684121c650b08cf8616285
[ "MIT" ]
29
2017-07-10T14:49:15.000Z
2022-02-02T23:14:38.000Z
scripts/test_tensorflow_spectrogram.py
Tubbz-alt/Vesper
76e5931ca0c7fbe070c53b1362ec246ec9007beb
[ "MIT" ]
167
2015-03-17T14:45:22.000Z
2022-03-30T21:00:05.000Z
scripts/test_tensorflow_spectrogram.py
Tubbz-alt/Vesper
76e5931ca0c7fbe070c53b1362ec246ec9007beb
[ "MIT" ]
4
2015-02-06T03:30:27.000Z
2020-12-27T08:38:52.000Z
""" Compares spectrogram computations with TensorFlow and Vesper. As of 2018-11-09, Vesper is a little more than three times faster than TensorFlow at computing spectrograms with a DFT size of 128. """ import functools import time import numpy as np import tensorflow as tf import vesper.util.data_windows as data_windows import vesper.util.time_frequency_analysis_utils as tfa_utils SHOW_SPECTROGRAMS = False SAMPLE_RATE = 24000 # Hertz AMPLITUDE = 1 FREQUENCY = 3000 # Hertz DURATION = 1000 # seconds WINDOW_SIZE = .005 # seconds HOP_SIZE = .5 # fraction of window size if SHOW_SPECTROGRAMS: SAMPLE_RATE = 1 FREQUENCY = .25 DURATION = 8 WINDOW_SIZE = 8 HOP_SIZE = 1 if __name__ == '__main__': main()
26.146552
78
0.672272
88e5027947cf3cde1a9b3d2b5bfc1dfa177d0b10
110
py
Python
html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py
ziransun/wpt
ab8f451eb39eb198584d547f5d965ef54df2a86a
[ "BSD-3-Clause" ]
777
2017-08-29T15:15:32.000Z
2022-03-21T05:29:41.000Z
html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py
ziransun/wpt
ab8f451eb39eb198584d547f5d965ef54df2a86a
[ "BSD-3-Clause" ]
66
2017-08-30T18:31:18.000Z
2021-08-02T10:59:35.000Z
html/semantics/embedded-content/media-elements/loading-the-media-resource/resources/delayed-broken-video.py
ziransun/wpt
ab8f451eb39eb198584d547f5d965ef54df2a86a
[ "BSD-3-Clause" ]
123
2017-08-30T01:19:34.000Z
2022-03-17T22:55:31.000Z
import time
18.333333
49
0.663636
88e6289afe035056ed74d3dd93dfce6766f5f5c7
401
py
Python
tests/util.py
alexsilva/django-npm
8d5c55c0219fda074ceabdd93b3806e65a008d9e
[ "MIT" ]
null
null
null
tests/util.py
alexsilva/django-npm
8d5c55c0219fda074ceabdd93b3806e65a008d9e
[ "MIT" ]
null
null
null
tests/util.py
alexsilva/django-npm
8d5c55c0219fda074ceabdd93b3806e65a008d9e
[ "MIT" ]
1
2019-10-17T15:13:13.000Z
2019-10-17T15:13:13.000Z
import os from django.conf import settings import django
21.105263
73
0.583541
88e644ee347cd6bc7d3ce925d9db807476d778e2
2,770
py
Python
Station A/Pooling M300/v1_station_a_S30_pooling.py
Opentrons/covid19-system-30
4db5980a93e87f9f607b727678b7ea6d528109ba
[ "Apache-2.0" ]
null
null
null
Station A/Pooling M300/v1_station_a_S30_pooling.py
Opentrons/covid19-system-30
4db5980a93e87f9f607b727678b7ea6d528109ba
[ "Apache-2.0" ]
null
null
null
Station A/Pooling M300/v1_station_a_S30_pooling.py
Opentrons/covid19-system-30
4db5980a93e87f9f607b727678b7ea6d528109ba
[ "Apache-2.0" ]
1
2020-07-29T14:52:28.000Z
2020-07-29T14:52:28.000Z
from opentrons import protocol_api import json import os import math # metadata metadata = { 'protocolName': 'V1 S14 Station A MagMax', 'author': 'Nick <protocols@opentrons.com>', 'source': 'Custom Protocol Request', 'apiLevel': '2.4' } NUM_SAMPLES = 64 SAMPLE_VOLUME = 100 TIP_TRACK = False
31.123596
78
0.574729
88e81d74f7c94f8645b9faca1575d321f2ec48d6
2,683
py
Python
rlxnix/plugins/efish/baseline.py
jgrewe/relacsed_nix
8c5bf486018891baf886635608677faf2487fd48
[ "BSD-3-Clause" ]
null
null
null
rlxnix/plugins/efish/baseline.py
jgrewe/relacsed_nix
8c5bf486018891baf886635608677faf2487fd48
[ "BSD-3-Clause" ]
3
2021-11-04T17:32:35.000Z
2021-11-07T11:10:35.000Z
rlxnix/plugins/efish/baseline.py
jgrewe/relacsed_nix
8c5bf486018891baf886635608677faf2487fd48
[ "BSD-3-Clause" ]
null
null
null
import logging import numpy as np from .efish_ephys_repro import EfishEphys
33.962025
182
0.61312
88e86a165bc8af8615ecf882a5209b22de9aecc5
1,258
py
Python
blogs/migrations/0001_initial.py
daniil-lebedev/N3code-site
bda415bd2140f582ae22101b55f34fc2786d7b45
[ "MIT" ]
3
2021-05-30T18:26:40.000Z
2021-07-17T11:45:53.000Z
blogs/migrations/0001_initial.py
daniil-lebedev/N3code-site
bda415bd2140f582ae22101b55f34fc2786d7b45
[ "MIT" ]
5
2021-06-06T16:13:42.000Z
2022-02-10T12:10:23.000Z
blogs/migrations/0001_initial.py
daniil-lebedev/N3code-site
bda415bd2140f582ae22101b55f34fc2786d7b45
[ "MIT" ]
8
2021-06-02T15:00:46.000Z
2021-07-15T21:27:33.000Z
# Generated by Django 3.2.3 on 2021-05-17 15:31 from django.db import migrations, models import django.db.models.deletion
34
117
0.557234
88e9ebaa162edc8b9d8c063256bea5900e94971c
5,101
py
Python
Reuters/reuters.py
dheeraj7596/SCDV
e83fc81e1b59bebfa2fa1e334097caa44f9e7f48
[ "MIT" ]
60
2017-05-25T14:08:50.000Z
2022-02-04T19:29:44.000Z
Reuters/reuters.py
vgupta123/SCDV
329b13a413318262f1888d872d8e33b30217cbc7
[ "MIT" ]
2
2020-03-27T14:01:12.000Z
2020-07-16T14:33:31.000Z
Reuters/reuters.py
vgupta123/SCDV
329b13a413318262f1888d872d8e33b30217cbc7
[ "MIT" ]
19
2017-11-10T01:06:28.000Z
2021-09-25T19:31:25.000Z
# Reuters-21578 dataset downloader and parser # # Author: Eustache Diemert <eustache@diemert.fr> # http://scikit-learn.org/stable/auto_examples/applications/plot_out_of_core_classification.html # # Modified by @herrfz, get pandas DataFrame from the orig SGML # License: BSD 3 clause from __future__ import print_function import re import os.path import fnmatch import sgmllib import urllib import tarfile import itertools from pandas import DataFrame ############################################################################### # Reuters Dataset related routines ############################################################################### def get_minibatch(doc_iter, size): """Extract a minibatch of examples, return a tuple X, y. Note: size is before excluding invalid docs with no topics assigned. """ data = [('{title}\n\n{body}'.format(**doc), doc['topics']) for doc in itertools.islice(doc_iter, size) if doc['topics']] if not len(data): return DataFrame([]) else: return DataFrame(data, columns=['text', 'tags'])
30.183432
96
0.556558
88eac0a7976441ef42ccc1c8a624876cda4f745b
7,908
py
Python
sims/ch4-effective-g1-duration/run-well-mixed-effective-g1-duration.py
ThomasPak/cell-competition
bb058d67e297d95c4c8ff2a0aea5b1fe5a82be09
[ "BSD-3-Clause" ]
null
null
null
sims/ch4-effective-g1-duration/run-well-mixed-effective-g1-duration.py
ThomasPak/cell-competition
bb058d67e297d95c4c8ff2a0aea5b1fe5a82be09
[ "BSD-3-Clause" ]
null
null
null
sims/ch4-effective-g1-duration/run-well-mixed-effective-g1-duration.py
ThomasPak/cell-competition
bb058d67e297d95c4c8ff2a0aea5b1fe5a82be09
[ "BSD-3-Clause" ]
null
null
null
import numpy as np import pandas as pd from scipy.stats import expon, uniform import sys sys.path.append('../../well_mixed') from well_mixed_death_clock import (WellMixedSimulator, WellMixedSimulationData, exponential_ccm, uniform_ccm, base_rate_death_signal) # Exponential cell cycle model tG1 = 50 tG2 = 50 # Constant base rate death signal f = base_rate_death_signal base_rate = 1 Tdeath_fun = lambda eta: eta * base_rate * tG1 # Simulation parameters tstart = 0 tend = np.inf max_cell_count = 1000 initial_cell_count = 64 num_eta = 10 num_iter = 100 # Arguments to f and ccm f_args = (base_rate,) ccm_args = (tG1,) # Helper function if __name__ == '__main__': # Exponential ccm parameter sweep etas = np.arange(4 / num_eta, 4 + 4 / num_eta, 4 / num_eta) # Generate parameters eta_data = [] for eta in etas: for i in range(num_iter): eta_data.append(eta) # If initial seed is given as command-line arguments, create seeds in # increments of 2 to avoid correlations between simulations because seed + # 1 is used for initial conditions. if len(sys.argv) == 2: initial_seed = int(sys.argv[1]) seed_data = np.arange(initial_seed, initial_seed + 2 * len(eta_data), 2) else: seed_data = [None] * len(eta_data) # Run simulations and postprocess data status_data = [] final_timestep_data = [] final_cell_count_data = [] num_divisions_data = [] num_deaths_data = [] average_time_in_G1_data = [] effective_g1_sample_size_data = [] for eta, seed in zip(eta_data, seed_data): sim_data = run_g1_truncation_exponential_simulation(eta, seed) status = sim_data.get_status() t_events = sim_data.get_t_events() cell_count = sim_data.get_cell_count() num_divisions = sim_data.get_num_divisions() num_deaths = sim_data.get_num_deaths() effective_time_in_G1 = sim_data.get_effective_time_in_G1() if status == 0: final_timestep = t_events[-1] else: final_timestep = t_events[-2] final_cell_count = cell_count[-1] average_time_in_G1 = np.mean(effective_time_in_G1) effective_g1_sample_size = len(effective_time_in_G1) status_data.append(status) final_timestep_data.append(final_timestep) final_cell_count_data.append(final_cell_count) num_divisions_data.append(num_divisions) num_deaths_data.append(num_deaths) average_time_in_G1_data.append(average_time_in_G1) effective_g1_sample_size_data.append(effective_g1_sample_size) # Create and write dataframe df = pd.DataFrame({ 'eta' : eta_data, 'seed' : seed_data, 'status' : status_data, 'final_timestep' : final_timestep_data, 'final_cell_count' : final_cell_count_data, 'num_divisions' : num_divisions_data, 'num_deaths' : num_deaths_data, 'average_time_in_G1' : average_time_in_G1_data, 'effective_g1_sample_size' : effective_g1_sample_size_data, }) df.to_csv('exponential-effective-g1-duration-data.csv', index_label='simulation_id') # Uniform ccm r_fun = lambda alpha: 2 * alpha * tG1 # Helper function if __name__ == '__main__': # Uniform ccm parameter sweep alphas = [0.3, 0.5, 0.7, 1.0] etas = np.arange(2 / num_eta, 2 + 2 / num_eta, 2 / num_eta) # Generate parameters alpha_data = [] eta_data = [] for alpha in alphas: for eta in etas: for i in range(num_iter): alpha_data.append(alpha) eta_data.append(eta) # If initial seed is given as command-line arguments, create seeds in # increments of 2 to avoid correlations between simulations because seed + # 1 is used for initial conditions. if len(sys.argv) == 2: initial_seed = int(sys.argv[1]) seed_data = np.arange(initial_seed, initial_seed + 2 * len(eta_data), 2) else: seed_data = [None] * len(eta_data) # Run simulations and postprocess data status_data = [] final_timestep_data = [] final_cell_count_data = [] num_divisions_data = [] num_deaths_data = [] average_time_in_G1_data = [] effective_g1_sample_size_data = [] for alpha, eta, seed in zip(alpha_data, eta_data, seed_data): sim_data = run_g1_truncation_uniform_simulation(alpha, eta, seed) status = sim_data.get_status() t_events = sim_data.get_t_events() cell_count = sim_data.get_cell_count() num_divisions = sim_data.get_num_divisions() num_deaths = sim_data.get_num_deaths() effective_time_in_G1 = sim_data.get_effective_time_in_G1() if status == 0: final_timestep = t_events[-1] else: final_timestep = t_events[-2] final_cell_count = cell_count[-1] average_time_in_G1 = np.mean(effective_time_in_G1) effective_g1_sample_size = len(effective_time_in_G1) status_data.append(status) final_timestep_data.append(final_timestep) final_cell_count_data.append(final_cell_count) num_divisions_data.append(num_divisions) num_deaths_data.append(num_deaths) average_time_in_G1_data.append(average_time_in_G1) effective_g1_sample_size_data.append(effective_g1_sample_size) # Create and write dataframe df = pd.DataFrame({ 'alpha' : alpha_data, 'eta' : eta_data, 'seed' : seed_data, 'status' : status_data, 'final_timestep' : final_timestep_data, 'final_cell_count' : final_cell_count_data, 'num_divisions' : num_divisions_data, 'num_deaths' : num_deaths_data, 'average_time_in_G1' : average_time_in_G1_data, 'effective_g1_sample_size' : effective_g1_sample_size_data, }) df.to_csv('uniform-effective-g1-duration-data.csv', index_label='simulation_id')
31.759036
88
0.682473
88ec6c26cd7a2f727e00f467fdd178e22cb46386
810
py
Python
hello/hello_sqlite.py
East196/hello-py
a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21
[ "Apache-2.0" ]
1
2017-10-23T14:58:47.000Z
2017-10-23T14:58:47.000Z
hello/hello_sqlite.py
East196/hello-py
a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21
[ "Apache-2.0" ]
null
null
null
hello/hello_sqlite.py
East196/hello-py
a77c7a0c8e5e2b5e8cefaf0fda335ab0c3b1da21
[ "Apache-2.0" ]
1
2018-04-06T07:49:18.000Z
2018-04-06T07:49:18.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- # SQLite: import sqlite3 # SQLite # test.db # : conn = sqlite3.connect('hello.db') # Cursor: cursor = conn.cursor() cursor.execute('drop table user') # SQLuser: cursor.execute('create table user (id varchar(20) primary key, name varchar(20))') # SQL: cursor.execute('insert into user (id, name) values (\'1\', \'Michael\')') cursor.execute('insert into user (id, name) values (\'2\', \'Jackson\')') # rowcount: print(cursor.rowcount) # : print(cursor.execute('select * from user').fetchall()) print(cursor.execute('select * from user').fetchmany(size=1)) print(cursor.execute('select * from user').fetchone()) # Cursor: cursor.close() # : conn.commit() # Connection: conn.close()
26.129032
82
0.707407
88edaae7baa65ef0737db43dff89261e7016c55e
1,324
py
Python
ig_data/InstaSearch.py
swapnanildutta/instagram-search
919a3383f0f7789671108f899d9ba9092a69009f
[ "MIT" ]
1
2022-01-04T16:51:50.000Z
2022-01-04T16:51:50.000Z
ig_data/InstaSearch.py
swapnanildutta/instagram-search
919a3383f0f7789671108f899d9ba9092a69009f
[ "MIT" ]
3
2020-10-26T13:31:05.000Z
2022-01-05T23:11:42.000Z
ig_data/InstaSearch.py
swapnanildutta/instagram-search
919a3383f0f7789671108f899d9ba9092a69009f
[ "MIT" ]
2
2020-04-07T09:24:07.000Z
2020-04-14T06:38:49.000Z
# imports import requests, json # beautifulsoup4 from bs4 import BeautifulSoup
33.948718
116
0.58006
88ef1b2b45df53d3ae9e2451d75c76436af81011
2,369
py
Python
tests/jax_ops_test.py
ita9naiwa/fast-soft-sort
72cbd93ecc229736f9e05bfdfd0f48c09432904f
[ "Apache-2.0" ]
389
2020-06-08T22:30:18.000Z
2022-03-25T23:04:28.000Z
tests/jax_ops_test.py
ita9naiwa/fast-soft-sort
72cbd93ecc229736f9e05bfdfd0f48c09432904f
[ "Apache-2.0" ]
14
2020-06-21T13:21:51.000Z
2021-10-18T18:02:07.000Z
tests/jax_ops_test.py
ita9naiwa/fast-soft-sort
72cbd93ecc229736f9e05bfdfd0f48c09432904f
[ "Apache-2.0" ]
32
2020-06-20T17:25:10.000Z
2022-03-26T13:34:23.000Z
# 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Tests for jax_ops.py.""" import functools import itertools import unittest from absl.testing import absltest from absl.testing import parameterized import numpy as np import jax.numpy as jnp import jax from jax.config import config config.update("jax_enable_x64", True) from fast_soft_sort import jax_ops GAMMAS = (0.1, 1, 10.0) DIRECTIONS = ("ASCENDING", "DESCENDING") REGULARIZERS = ("l2", ) if __name__ == "__main__": absltest.main()
32.452055
80
0.71718
88ef5220f71a9bb493ff8c46c52c8179ab59c4c0
507
py
Python
server/accounts/migrations/0004_userdata_primaryfield.py
cristicismas/top-budget
d61db578287b2f77c12032045fca21e58c9ae1eb
[ "MIT" ]
null
null
null
server/accounts/migrations/0004_userdata_primaryfield.py
cristicismas/top-budget
d61db578287b2f77c12032045fca21e58c9ae1eb
[ "MIT" ]
11
2019-12-05T15:21:40.000Z
2021-10-05T22:08:17.000Z
server/accounts/migrations/0004_userdata_primaryfield.py
cristicismas/top-budget
d61db578287b2f77c12032045fca21e58c9ae1eb
[ "MIT" ]
null
null
null
# Generated by Django 2.2.5 on 2019-09-25 14:30 from django.db import migrations, models
26.684211
164
0.619329
88ef90d13386cd8f42e7af523b73ce0b09325d97
580
bzl
Python
source/bazel/deps/Poppy/get.bzl
luxe/unilang
6c8a431bf61755f4f0534c6299bd13aaeba4b69e
[ "MIT" ]
33
2019-05-30T07:43:32.000Z
2021-12-30T13:12:32.000Z
source/bazel/deps/Poppy/get.bzl
luxe/unilang
6c8a431bf61755f4f0534c6299bd13aaeba4b69e
[ "MIT" ]
371
2019-05-16T15:23:50.000Z
2021-09-04T15:45:27.000Z
source/bazel/deps/Poppy/get.bzl
luxe/unilang
6c8a431bf61755f4f0534c6299bd13aaeba4b69e
[ "MIT" ]
6
2019-08-22T17:37:36.000Z
2020-11-07T07:15:32.000Z
# Do not edit this file directly. # It was auto-generated by: code/programs/reflexivity/reflexive_refresh load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
34.117647
103
0.706897
88f03654581e59a140ad7f0b316b54846b6a53fc
99
py
Python
openfecli/commands/__init__.py
mikemhenry/openfe
d4c78af62a7ae05b99eb95d173661ac134b7e7b9
[ "MIT" ]
14
2022-01-24T22:01:19.000Z
2022-03-31T04:58:35.000Z
openfecli/commands/__init__.py
mikemhenry/openfe
d4c78af62a7ae05b99eb95d173661ac134b7e7b9
[ "MIT" ]
109
2022-01-24T18:57:05.000Z
2022-03-31T20:13:07.000Z
openfecli/commands/__init__.py
mikemhenry/openfe
d4c78af62a7ae05b99eb95d173661ac134b7e7b9
[ "MIT" ]
4
2022-01-24T18:45:54.000Z
2022-02-21T06:28:24.000Z
# shouldn't apparently need this file, but here we are from . import atommapping from . import echo
33
54
0.777778
88f18a67e803424dde5d28eb3302913d647a3a2f
27,163
py
Python
src/pages/pe_cuencas.py
ValentinSilvestri/cammesa
33ff17ad4a0447fd4668b6adad1c4bbfd88aba8e
[ "MIT" ]
null
null
null
src/pages/pe_cuencas.py
ValentinSilvestri/cammesa
33ff17ad4a0447fd4668b6adad1c4bbfd88aba8e
[ "MIT" ]
null
null
null
src/pages/pe_cuencas.py
ValentinSilvestri/cammesa
33ff17ad4a0447fd4668b6adad1c4bbfd88aba8e
[ "MIT" ]
null
null
null
import os import re import pymongo import pandas as pd import numpy as np import streamlit as st from bokeh.plotting import figure from bokeh.palettes import Set1_9, Set3_12, Inferno256 def caudales(): """Get the rivers basin flows and process this data. Returns: Figure: Bokeh plotting figure. DataFrame: Pandas DataFrame with the query result. """ df = get_caudales() df = pd.concat([ df['fecha'], pd.json_normalize(df['situacionCuencaComahue']), pd.json_normalize(df['situacionYacyretaSaltoGrande']), pd.json_normalize(df['situacionCuencaPatagonica']), pd.json_normalize(df['situacionCuencaRioGrande']), pd.json_normalize(df['situacionCuencaRioSanJuan']) ], axis=1, join="inner") df.rename(columns={ "fecha": "Fecha", "Caudal Collon Cura": "Cuenca Comahue - Caudal Collon Cura", "Caudal Neuquen": "Cuenca Comahue - Caudal Neuquen", "Caudal Limay": "Cuenca Comahue - Caudal Limay", "Caudal Ro Negro": "Cuenca Comahue - Caudal Ro Negro", "Caudal Limay despues desembocadura de Collon Cura": "Cuenca Comahue - Caudal Limay despues desembocadura de Collon Cura", "Caudal Ro Uruguay": "Yacyreta Salto Grande - Caudal Ro Uruguay", "Caudal Ro Paran": "Yacyreta Salto Grande - Caudal Ro Paran", "Caudal Ro Chubut": "Cuenca Patagnica - Caudal Ro Chubut", "Caudal Ro Futaleufu": "Cuenca Patagnica - Caudal Ro Futaleufu", "Caudal Ro Grande": "Cuenca Ro Grande - Caudal Ro Grande", "Caudal Inicial Ro San Juan": "Cuenca Ro San Juan - Caudal Inicial Ro San Juan", "Caudal Final Ro San Juan": "Cuenca Ro San Juan - Caudal Final Ro San Juan" }, inplace=True) df['Fecha'] = pd.to_datetime(df['Fecha'], format='%Y/%m/%d').dt.date df = df.drop_duplicates().sort_values('Fecha', ascending=False).reset_index(drop=True) df = df.replace(0, np.nan) p = figure(x_axis_type="datetime", title="Caudales cuencas", sizing_mode="stretch_both") p.grid.grid_line_alpha=0.3 p.xaxis.axis_label = 'Fecha' p.yaxis.axis_label = 'Caudal [m\u00b3/s]' p.legend.location = "top_left" return p, df def cotas(): """Get the rivers basin levels and process this data. Returns: Figure: Bokeh plotting figure. DataFrame: Pandas DataFrame with the query result. """ df = get_cotas() df = pd.concat([ df['fecha'], pd.json_normalize(df['situacionCuencaComahue']), pd.json_normalize(df['situacionYacyretaSaltoGrande']), pd.json_normalize(df['situacionCuencaPatagonica']), pd.json_normalize(df['situacionCuencaRioGrande']), pd.json_normalize(df['situacionCuencaRioSanJuan']) ], axis=1, join="inner") df.rename(columns={ 'fecha': 'Fecha', 'Cota Hoy Alicura': 'Cuenca Comahue - Alicura', 'Cota Min Alicura': 'Cuenca Comahue - Min Alicura', 'Cota Max Alicura': 'Cuenca Comahue - Max Alicura', 'Cota Hoy Piedra del Aguila': 'Cuenca Comahue - Piedra del Aguil', 'Cota Min Piedra del Aguila': 'Cuenca Comahue - Min Piedra del Aguila', 'Cota Max Piedra del Aguila': 'Cuenca Comahue - Max Piedra del Aguila', 'Cota Hoy Arroyito': 'Cuenca Comahue - Arroyito', 'Cota Min Arroyito': 'Cuenca Comahue - Min Arroyito', 'Cota Max Arroyito': 'Cuenca Comahue - Max Arroyito', 'Cota Hoy Mari Menuco': 'Cuenca Comahue - Mari Menuco', 'Cota Min Mari Menuco': 'Cuenca Comahue - Min Mari Menuco', 'Cota Max Mari Menuco': 'Cuenca Comahue - Max Mari Menuco', 'Cota Hoy Planicie Banderita Barreales': 'Cuenca Comahue - Planicie Banderita Barreales', 'Cota Min Planicie Banderita Barreales': 'Cuenca Comahue - Min Planicie Banderita Barreales', 'Cota Max Planicie Banderita Barreales': 'Cuenca Comahue - Max Planicie Banderita Barreales', 'Cota Hoy El Chocon': 'Cuenca Comahue - El Chocon', 'Cota Min El Chocon': 'Cuenca Comahue - Min El Chocon', 'Cota Max El Chocon': 'Cuenca Comahue - Max El Chocon', 'Cota Hoy P.P.Leufu': 'Cuenca Comahue - Leufu', 'Cota Hoy Yacyreta': 'Cuenca Yacyreta - Yacyreta', 'Cota Min Yacyreta': 'Cuenca Yacyreta - Min Yacyreta', 'Cota Max Yacyreta': 'Cuenca Yacyreta - Max Yacyreta', 'Cota Hoy Salto Grande': 'Cuenca Yacyreta - Salto Grande', 'Cota Min Salto Grande': 'Cuenca Yacyreta - Min Salto Grande', 'Cota Max Salto Grande': 'Cuenca Yacyreta - Max Salto Grande', 'Cota Hoy Futaleufu': 'Cuenca Patagnica - Futaleufu', 'Cota Min Futaleufu': 'Cuenca Patagnica - Min Futaleufu', 'Cota Max Futaleufu': 'Cuenca Patagnica - Max Futaleufu', 'Cota Hoy Ameghino': 'Cuenca Patagnica - Ameghino', 'Cota Min Ameghino': 'Cuenca Patagnica - Min Ameghino', 'Cota Max Ameghino': 'Cuenca Patagnica - Max Ameghino', 'Cota Hoy Ro Grande': 'Cuenca Ro Grande - Ro Grande', 'Cota Min Ro Grande': 'Cuenca Ro Grande - Min Ro Grande', 'Cota Max Ro Grande': 'Cuenca Ro Grande - Max Ro Grande', 'Cota Hoy Quebrada de Ullum': 'Cuenca Ro San Juan - Quebrada de Ullum', 'Cota Min Quebrada de Ullum': 'Cuenca Ro San Juan - Min Quebrada de Ullum', 'Cota Max Quebrada de Ullum': 'Cuenca Ro San Juan - Max Quebrada de Ullum', 'Cota Hoy Punta Negra': 'Cuenca Ro San Juan - Punta Negra', 'Cota Min Punta Negra': 'Cuenca Ro San Juan - Min Punta Negra', 'Cota Max Punta Negra': 'Cuenca Ro San Juan - Max Punta Negra' }, inplace=True) df['Fecha'] = pd.to_datetime(df['Fecha'], format='%Y/%m/%d').dt.date df = df.drop_duplicates().sort_values('Fecha', ascending=False).reset_index(drop=True) df = df.replace(0, np.nan) p = figure(x_axis_type="datetime", title="Cotas cuencas", sizing_mode="stretch_both") p.grid.grid_line_alpha=0.3 p.xaxis.axis_label = 'Fecha' p.yaxis.axis_label = 'Cota [cm]' p.legend.location = "top_left" return p, df def turbinado(): """Get the rivers basin discharge and process this data. Returns: Figure: Bokeh plotting figure. DataFrame: Pandas DataFrame with the query result. """ df = get_turbinado() df = pd.concat([ df['fecha'], pd.json_normalize(df['situacionCuencaComahue']), pd.json_normalize(df['situacionYacyretaSaltoGrande']), pd.json_normalize(df['situacionCuencaPatagonica']), pd.json_normalize(df['situacionCuencaRioGrande']), pd.json_normalize(df['situacionCuencaRioSanJuan']) ], axis=1, join="inner") df.rename(columns={ 'fecha': 'Fecha', 'Turbinado Alicura': 'Cuenca Comahue - Alicura', 'Turbinado Piedra del Aguila': 'Cuenca Comahue - Piedra del Aguila', 'Turbinado Arroyito': 'Cuenca Comahue - Arroyito', 'Turbinado El Chocon': 'Cuenca Comahue - El Chocon', 'Turbinado Mari Menuco': 'Cuenca Comahue - Mari Menuco', 'Turbinado P.P.Leufu': 'Cuenca Comahue - Leufu', 'Turbinado Salto Grande': 'Cuenca Yacyreta - Salto Grande', 'Turbinado Yacyreta': 'Cuenca Yacyreta - Yacyreta', 'Turbinado Futaleufu': 'Cuenca Patagnica - Futaleufu', 'Turbinado Ameghino': 'Cuenca Patagnica - Ameghino', 'Turbinado Ro Grande': 'Cuenca Ro Grande - Ro Grande', 'Turbinado Punta Negra': 'Cuenca Ro San Juan - Punta Negra', 'Turbinado Ullum': 'Cuenca Ro San Juan - Ullum', 'Turbinado Los Caracoles': 'Cuenca Ro San Juan - Los Caracoles', 'Turbinado Quebrada de Ullum': 'Cuenca Ro San Juan - Quebrada de Ullum' }, inplace=True) df['Fecha'] = pd.to_datetime(df['Fecha'], format='%Y/%m/%d').dt.date df = df.drop_duplicates().sort_values('Fecha', ascending=False).reset_index(drop=True) # df = df.replace(0, np.nan) p = figure(x_axis_type="datetime", title="Turbinado", sizing_mode="stretch_both") p.grid.grid_line_alpha=0.3 p.xaxis.axis_label = 'Fecha' p.yaxis.axis_label = 'Turbinado' p.legend.location = "top_left" return p, df def vertido(): """Get the rivers basin discharge and process this data. Returns: Figure: Bokeh plotting figure. DataFrame: Pandas DataFrame with the query result. """ df = get_vertido() df = pd.concat([ df['fecha'], pd.json_normalize(df['situacionCuencaComahue']), pd.json_normalize(df['situacionYacyretaSaltoGrande']), pd.json_normalize(df['situacionCuencaPatagonica']), pd.json_normalize(df['situacionCuencaRioGrande']), pd.json_normalize(df['situacionCuencaRioSanJuan']) ], axis=1, join="inner") df.rename(columns={ 'fecha': 'Fecha', 'Vertido El Chaar': 'Cuenca Comahue - El Chaar', 'Vertido Arroyito': 'Cuenca Comahue - Arroyito', 'Vertido Piedra del Aguila': 'Cuenca Comahue - Piedra del Aguila', 'Vertido P.P.Leufu': 'Cuenca Comahue - Leufu', 'Vertido Salto Grande': 'Cuenca Yacyreta - Salto Grande', 'Vertido Yacyreta': 'Cuenca Yacyreta - Yacyreta', 'Vertido Futaleufu': 'Cuenca Patagnica - Futaleufu', 'Vertido Ameghino': 'Cuenca Patagnica - Ameghino', 'Bombeo Ro Grande': 'Cuenca Ro Grande - Bombeo Ro Grande', 'Vertido Punta Negra': 'Cuenca Ro San Juan - Punta Negra', 'Vertido Los Caracoles': 'Cuenca Ro San Juan - Los Caracoles', 'Vertido Quebrada de Ullum': 'Cuenca Ro San Juan - Quebrada de Ullum' }, inplace=True) df['Fecha'] = pd.to_datetime(df['Fecha'], format='%Y/%m/%d').dt.date df = df.drop_duplicates().sort_values('Fecha', ascending=False).reset_index(drop=True) # df = df.replace(0, np.nan) p = figure(x_axis_type="datetime", title="Vertido", sizing_mode="stretch_both") p.grid.grid_line_alpha=0.3 p.xaxis.axis_label = 'Fecha' p.yaxis.axis_label = 'Vertido' p.legend.location = "top_left" return p, df def write(): """Function to write the Streamlit content of the page pe_cuencas """ p_caudales, df_caudales = caudales() p_cotas, df_cotas = cotas() p_turbinado, df_turbinado = turbinado() p_vertido, df_vertido = vertido() st.header("Publicaciones especiales - Cuencas/Datos Hidrulicos ", anchor=None) with st.container(): st.subheader("Anlisis de caudales", anchor=None) options = st.multiselect( "Seleccionar datos a graficar.", options=[ "Cuenca Comahue - Caudal Collon Cura", "Cuenca Comahue - Caudal Neuquen", "Cuenca Comahue - Caudal Limay", "Cuenca Comahue - Caudal Ro Negro", "Cuenca Comahue - Caudal Limay despues desembocadura de Collon Cura", "Yacyreta Salto Grande - Caudal Ro Uruguay", "Yacyreta Salto Grande - Caudal Ro Paran", "Cuenca Patagnica - Caudal Ro Chubut", "Cuenca Patagnica - Caudal Ro Futaleufu", "Cuenca Ro Grande - Caudal Ro Grande", "Cuenca Ro San Juan - Caudal Inicial Ro San Juan", "Cuenca Ro San Juan - Caudal Final Ro San Juan" ], default=[ "Yacyreta Salto Grande - Caudal Ro Paran", "Yacyreta Salto Grande - Caudal Ro Uruguay" ] ) if len(options)>9: col = Set3_12 else: col = Set1_9 for index, value in enumerate(options): p_caudales.line( df_caudales['Fecha'], df_caudales[value], color=col[index], legend_label=re.split(r" - ", value)[1].strip() ) st.bokeh_chart(p_caudales) with st.expander("Ver datos"): st.write("Datos de los caudales de las cuencas en [m\u00b3/s].") st.dataframe(df_caudales) st.download_button( label="Descargar dataset como .CSV", data=df_caudales.to_csv(index=False).encode('utf-8'), file_name='Caudales.csv', mime='text/csv', ) with st.container(): st.subheader("Anlisis de cotas", anchor=None) options_cotas = st.multiselect( "Seleccionar datos a graficar.", options=[ 'Cuenca Comahue - Alicura', 'Cuenca Comahue - Min Alicura', 'Cuenca Comahue - Max Alicura', 'Cuenca Comahue - Piedra del Aguil', 'Cuenca Comahue - Min Piedra del Aguila', 'Cuenca Comahue - Max Piedra del Aguila', 'Cuenca Comahue - Arroyito', 'Cuenca Comahue - Min Arroyito', 'Cuenca Comahue - Max Arroyito', 'Cuenca Comahue - Mari Menuco', 'Cuenca Comahue - Min Mari Menuco', 'Cuenca Comahue - Max Mari Menuco', 'Cuenca Comahue - Planicie Banderita Barreales', 'Cuenca Comahue - Min Planicie Banderita Barreales', 'Cuenca Comahue - Max Planicie Banderita Barreales', 'Cuenca Comahue - El Chocon', 'Cuenca Comahue - Min El Chocon', 'Cuenca Comahue - Max El Chocon', 'Cuenca Comahue - Leufu', 'Cuenca Yacyreta - Yacyreta', 'Cuenca Yacyreta - Min Yacyreta', 'Cuenca Yacyreta - Max Yacyreta', 'Cuenca Yacyreta - Salto Grande', 'Cuenca Yacyreta - Min Salto Grande', 'Cuenca Yacyreta - Max Salto Grande', 'Cuenca Patagnica - Futaleufu', 'Cuenca Patagnica - Min Futaleufu', 'Cuenca Patagnica - Max Futaleufu', 'Cuenca Patagnica - Ameghino', 'Cuenca Patagnica - Min Ameghino', 'Cuenca Patagnica - Max Ameghino', 'Cuenca Ro Grande - Ro Grande', 'Cuenca Ro Grande - Min Ro Grande', 'Cuenca Ro Grande - Max Ro Grande', 'Cuenca Ro San Juan - Quebrada de Ullum', 'Cuenca Ro San Juan - Min Quebrada de Ullum', 'Cuenca Ro San Juan - Max Quebrada de Ullum', 'Cuenca Ro San Juan - Punta Negra', 'Cuenca Ro San Juan - Min Punta Negra', 'Cuenca Ro San Juan - Max Punta Negra' ], default=[ 'Cuenca Yacyreta - Salto Grande', 'Cuenca Yacyreta - Min Salto Grande', 'Cuenca Yacyreta - Max Salto Grande' ] ) if len(options_cotas)<=9: col = Set1_9 elif len(options_cotas) <=12: col = Set3_12 else: col = Inferno256 for index, value in enumerate(options_cotas): p_cotas.line( df_cotas['Fecha'], df_cotas[value], color=col[index], legend_label=re.split(r" - ", value)[1].strip() ) st.bokeh_chart(p_cotas) with st.expander("Ver datos"): st.write("Datos de los Cotas de las cuencas en [cm].") st.dataframe(df_cotas) st.download_button( label="Descargar dataset como .CSV", data=df_cotas.to_csv(index=False).encode('utf-8'), file_name='Cotas.csv', mime='text/csv', ) with st.container(): st.subheader("Anlisis del turbinado", anchor=None) options_turbinado = st.multiselect( "Seleccionar datos a graficar.", options=[ 'Cuenca Comahue - Alicura', 'Cuenca Comahue - Piedra del Aguila', 'Cuenca Comahue - Arroyito', 'Cuenca Comahue - El Chocon', 'Cuenca Comahue - Mari Menuco', 'Cuenca Comahue - Leufu', 'Cuenca Yacyreta - Salto Grande', 'Cuenca Yacyreta - Yacyreta', 'Cuenca Patagnica - Futaleufu', 'Cuenca Patagnica - Ameghino', 'Cuenca Ro Grande - Ro Grande', 'Cuenca Ro San Juan - Punta Negra', 'Cuenca Ro San Juan - Ullum', 'Cuenca Ro San Juan - Los Caracoles', 'Cuenca Ro San Juan - Quebrada de Ullum' ], default=[ 'Cuenca Yacyreta - Yacyreta', 'Cuenca Yacyreta - Salto Grande' ] ) if len(options_turbinado)<=9: col = Set1_9 elif len(options_turbinado) <=12: col = Set3_12 else: col = Inferno256 for index, value in enumerate(options_turbinado): p_turbinado.line( df_turbinado['Fecha'], df_turbinado[value], color=col[index], legend_label=re.split(r" - ", value)[1].strip() ) st.bokeh_chart(p_turbinado) with st.expander("Ver datos"): st.write("Datos del turbinado.") st.dataframe(df_turbinado) st.download_button( label="Descargar dataset como .CSV", data=df_turbinado.to_csv(index=False).encode('utf-8'), file_name='Turbinado.csv', mime='text/csv', ) with st.container(): st.subheader("Anlisis del vertido", anchor=None) options_vertido = st.multiselect( "Seleccionar datos a graficar.", options=[ 'Cuenca Comahue - El Chaar', 'Cuenca Comahue - Arroyito', 'Cuenca Comahue - Piedra del Aguila', 'Cuenca Comahue - Leufu', 'Cuenca Yacyreta - Salto Grande', 'Cuenca Yacyreta - Yacyreta', 'Cuenca Patagnica - Futaleufu', 'Cuenca Patagnica - Ameghino', 'Cuenca Ro Grande - Bombeo Ro Grande', 'Cuenca Ro San Juan - Punta Negra', 'Cuenca Ro San Juan - Los Caracoles', 'Cuenca Ro San Juan - Quebrada de Ullum' ], default=[ 'Cuenca Yacyreta - Yacyreta', 'Cuenca Yacyreta - Salto Grande' ] ) if len(options_vertido)>9: col = Set3_12 else: col = Set1_9 for index, value in enumerate(options_vertido): p_vertido.line( df_vertido['Fecha'], df_vertido[value], color=col[index], legend_label=re.split(r" - ", value)[1].strip() ) st.bokeh_chart(p_vertido) with st.expander("Ver datos"): st.write("Datos del vertido.") st.dataframe(df_vertido) st.download_button( label="Descargar dataset como .CSV", data=df_vertido.to_csv(index=False).encode('utf-8'), file_name='Vertido.csv', mime='text/csv', )
39.538574
130
0.555793
88f1cc3699cf5781999a9874993e5299f3224a9d
5,930
py
Python
utils/gen-vowel-constraints.py
ctrlcctrlv/fontFeatures
76d68586da2c1c42bb3cd79f92d583e63f52cf02
[ "BSD-3-Clause" ]
51
2020-01-15T09:28:51.000Z
2022-03-30T06:48:36.000Z
utils/gen-vowel-constraints.py
ctrlcctrlv/fontFeatures
76d68586da2c1c42bb3cd79f92d583e63f52cf02
[ "BSD-3-Clause" ]
51
2020-05-11T18:51:25.000Z
2021-12-20T12:55:08.000Z
utils/gen-vowel-constraints.py
ctrlcctrlv/fontFeatures
76d68586da2c1c42bb3cd79f92d583e63f52cf02
[ "BSD-3-Clause" ]
8
2020-08-28T20:03:14.000Z
2021-12-08T01:22:28.000Z
#!/usr/bin/env python3 """Generator of the function to prohibit certain vowel sequences. It creates ``_hb_preprocess_text_vowel_constraints``, which inserts dotted circles into sequences prohibited by the USE script development spec. This function should be used as the ``preprocess_text`` of an ``hb_ot_complex_shaper_t``. usage: ./gen-vowel-constraints.py ms-use/IndicShapingInvalidCluster.txt """ import collections import youseedee import sys if len (sys.argv) != 2: sys.exit (__doc__) script_order = {} scripts = {} for start, end,script in youseedee.parse_file_ranges("Scripts.txt"): for u in range (start, end + 1): scripts[u] = script if script not in script_order: script_order[script] = start constraints = {} with open (sys.argv[1], encoding='utf-8') as f: constraints_header = [] while True: line = f.readline ().strip () if line == '#': break constraints_header.append(line) for line in f: j = line.find ('#') if j >= 0: line = line[:j] constraint = [int (cp, 16) for cp in line.split (';')[0].split ()] if not constraint: continue assert 2 <= len (constraint), 'Prohibited sequence is too short: {}'.format (constraint) script = scripts[constraint[0]] if script in constraints: constraints[script].add (constraint) else: constraints[script] = ConstraintSet (constraint) assert constraints, 'No constraints found' print ('# The following functions are generated by running:') print ('# %s ms-use/IndicShapingInvalidCluster.txt' % sys.argv[0]) print(""" from fontFeatures.shaperLib.Buffer import BufferItem DOTTED_CIRCLE = 0x25CC def _insert_dotted_circle(buf, index): dotted_circle = BufferItem.new_unicode(DOTTED_CIRCLE) buf.items.insert(index, dotted_circle) """) print ('def preprocess_text_vowel_constraints(buffer):') for script, constraints in sorted (constraints.items (), key=lambda s_c: script_order[s_c[0]]): print(f' if buffer.script == "{script}":') print (' i = 0') print (' while i < len(buffer.items)-1:') print (' matched = False') write (str (constraints)) print (' i = i + 1') print (' if matched: _insert_dotted_circle(buffer, i)')
37.770701
130
0.579764
88f228f6aba01067ca766c9e905ecf9ba9e9f3a0
1,719
py
Python
rules.py
ONSdigital/blaise-data-delivery-alerts
5077ae6da9ef406549c994bc735745fcbb02e61d
[ "MIT" ]
null
null
null
rules.py
ONSdigital/blaise-data-delivery-alerts
5077ae6da9ef406549c994bc735745fcbb02e61d
[ "MIT" ]
null
null
null
rules.py
ONSdigital/blaise-data-delivery-alerts
5077ae6da9ef406549c994bc735745fcbb02e61d
[ "MIT" ]
null
null
null
from datetime import datetime, timedelta import pytz ALLOWED_AGE_PER_STATUS = { "default": 5 * 60, # LMS instruments can take a very long time to generate when the SPS is not cached "started": 35 * 60, "nifi_notified": 30 * 60, } COMPLETE_STATES = ["inactive", "in_arc"]
29.135593
87
0.709133
88f349a60a782c3197475116d0068eb5bfe4f4a8
2,229
py
Python
src/SocketServer.py
iamyyl/DDNS
537babb8a0f2debc65326f12ff3cc15d73692f98
[ "Apache-2.0" ]
null
null
null
src/SocketServer.py
iamyyl/DDNS
537babb8a0f2debc65326f12ff3cc15d73692f98
[ "Apache-2.0" ]
null
null
null
src/SocketServer.py
iamyyl/DDNS
537babb8a0f2debc65326f12ff3cc15d73692f98
[ "Apache-2.0" ]
null
null
null
import socket import select fd_to_socket = {} READ_ONLY = ( select.POLLIN | select.POLLPRI | select.POLLHUP | select.POLLERR) READ_WRITE = (READ_ONLY|select.POLLOUT) poller = select.poll() server = None IP = '127.0.0.1' Port = 7002
30.121622
79
0.544639
88f4ca8390bec41333df4559d2ca341bcce83beb
39,506
py
Python
pysnmp/A3COM-HUAWEI-SNA-DLSW-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/A3COM-HUAWEI-SNA-DLSW-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/A3COM-HUAWEI-SNA-DLSW-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module A3COM-HUAWEI-SNA-DLSW-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-SNA-DLSW-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:52:16 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # hwproducts, = mibBuilder.importSymbols("A3COM-HUAWEI-OID-MIB", "hwproducts") Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibIdentifier, ObjectIdentity, TimeTicks, Counter64, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Counter32, Bits, Gauge32, NotificationType, IpAddress, Integer32, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "ObjectIdentity", "TimeTicks", "Counter64", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Counter32", "Bits", "Gauge32", "NotificationType", "IpAddress", "Integer32", "Unsigned32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") dlsw = ModuleIdentity((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34)) if mibBuilder.loadTexts: dlsw.setLastUpdated('200410301551Z') if mibBuilder.loadTexts: dlsw.setOrganization('Huawei-3com Technologies co.,Ltd.') dlswNode = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1)) dlswTConn = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2)) dlswBridgeGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3)) dlswLocDirectory = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 4)) dlswCircuit = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5)) dlswSdlc = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6)) dlswLlc2 = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7)) dlswNodeVersion = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswNodeVersion.setStatus('current') dlswNodeVendorID = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswNodeVendorID.setStatus('current') dlswNodeVersionString = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswNodeVersionString.setStatus('current') dlswNodeStdPacingSupport = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 65535))).clone(namedValues=NamedValues(("none", 1), ("adaptiveRcvWindow", 2), ("fixedRcvWindow", 3), ("unknown", 65535)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswNodeStdPacingSupport.setStatus('current') dlswNodeStatus = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeStatus.setStatus('current') dlswNodeUpTime = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 6), Integer32()).setUnits('second').setMaxAccess("readonly") if mibBuilder.loadTexts: dlswNodeUpTime.setStatus('obsolete') dlswNodeVirtualSegmentLFSize = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 7), LFSize().clone('lfs1500')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeVirtualSegmentLFSize.setStatus('current') dlswNodeLocalAddr = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 8), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeLocalAddr.setStatus('current') dlswNodePriority = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 5), ValueRangeConstraint(65535, 65535), )).clone(5)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodePriority.setStatus('current') dlswNodeInitWindow = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 2000), ValueRangeConstraint(65535, 65535), )).clone(40)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeInitWindow.setStatus('current') dlswNodeKeepAlive = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 2000), ValueRangeConstraint(65535, 65535), )).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeKeepAlive.setStatus('current') dlswNodeMaxWindow = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 2000), ValueRangeConstraint(65535, 65535), )).clone(255)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeMaxWindow.setStatus('current') dlswNodePermitDynamic = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 65535))).clone(namedValues=NamedValues(("permitDynamic", 1), ("forbidDynamic", 2), ("unknown", 65535))).clone('forbidDynamic')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodePermitDynamic.setStatus('current') dlswNodeConnTimeout = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(300)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeConnTimeout.setStatus('current') dlswNodeLocalPendTimeout = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeLocalPendTimeout.setStatus('current') dlswNodeRemotePendTimeout = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeRemotePendTimeout.setStatus('current') dlswNodeSnaCacheTimeout = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(120)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswNodeSnaCacheTimeout.setStatus('current') dlswRemotePeerTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1), ) if mibBuilder.loadTexts: dlswRemotePeerTable.setStatus('current') dlswRemotePeerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-SNA-DLSW-MIB", "dlswRemotePeerAddr")) if mibBuilder.loadTexts: dlswRemotePeerEntry.setStatus('current') dlswRemotePeerAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 1), IpAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: dlswRemotePeerAddr.setStatus('current') dlswRemotePeerVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerVersion.setStatus('current') dlswRemotePeerVendorID = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerVendorID.setStatus('current') dlswRemotePeerPaceWindInit = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerPaceWindInit.setStatus('current') dlswRemotePeerNumOfTcpSessions = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerNumOfTcpSessions.setStatus('obsolete') dlswRemotePeerVersionString = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerVersionString.setStatus('current') dlswRemotePeerIsConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerIsConfig.setStatus('current') dlswRemotePeerSetStateToConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerSetStateToConfig.setStatus('obsolete') dlswRemotePeerCost = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswRemotePeerCost.setStatus('current') dlswRemotePeerKeepAlive = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswRemotePeerKeepAlive.setStatus('current') dlswRemotePeerLf = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 11), LFSize()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswRemotePeerLf.setStatus('current') dlswRemotePeerTcpQueneMax = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(50, 2000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswRemotePeerTcpQueneMax.setStatus('current') dlswRemotePeerHaveBackup = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerHaveBackup.setStatus('current') dlswRemotePeerIsBackup = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("yes", 1), ("no", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerIsBackup.setStatus('current') dlswRemotePeerBackupAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 15), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerBackupAddr.setStatus('current') dlswRemotePeerLinger = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1440)).clone(5)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswRemotePeerLinger.setStatus('current') dlswRemotePeerLinkState = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("connecting", 1), ("initCapExchange", 2), ("connected", 3), ("quiescing", 4), ("disconnecting", 5), ("disconnected", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerLinkState.setStatus('current') dlswRemotePeerRecvPacks = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerRecvPacks.setStatus('current') dlswRemotePeerSendPacks = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerSendPacks.setStatus('current') dlswRemotePeerDrops = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerDrops.setStatus('current') dlswRemotePeerUptime = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswRemotePeerUptime.setStatus('current') dlswRemotePeerEntryStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 2, 1, 1, 22), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswRemotePeerEntryStatus.setStatus('current') dlswBridgeTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 1), ) if mibBuilder.loadTexts: dlswBridgeTable.setStatus('current') dlswBridgeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-SNA-DLSW-MIB", "dlswBridgeNum")) if mibBuilder.loadTexts: dlswBridgeEntry.setStatus('current') dlswBridgeNum = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 63))) if mibBuilder.loadTexts: dlswBridgeNum.setStatus('current') dlswBridgeStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 1, 1, 2), CreateLineFlag()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswBridgeStatus.setStatus('current') dlswBridgeIfTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 2), ) if mibBuilder.loadTexts: dlswBridgeIfTable.setStatus('current') dlswBridgeIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: dlswBridgeIfEntry.setStatus('current') dlswBridgeIfBriGru = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswBridgeIfBriGru.setStatus('current') dlswBridgeIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 2, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswBridgeIfName.setStatus('current') dlswBridgeIfStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 3, 2, 1, 3), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswBridgeIfStatus.setStatus('current') dlswLocMacTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 4, 1), ) if mibBuilder.loadTexts: dlswLocMacTable.setStatus('current') dlswLocMacEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 4, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-SNA-DLSW-MIB", "dlswLocMacHashIndex"), (0, "A3COM-HUAWEI-SNA-DLSW-MIB", "dlswLocMacHashIndexSeqNum")) if mibBuilder.loadTexts: dlswLocMacEntry.setStatus('current') dlswLocMacHashIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 4, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: dlswLocMacHashIndex.setStatus('current') dlswLocMacHashIndexSeqNum = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 4, 1, 1, 2), Integer32()) if mibBuilder.loadTexts: dlswLocMacHashIndexSeqNum.setStatus('current') dlswLocMacMac = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 4, 1, 1, 3), MacAddressNC()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswLocMacMac.setStatus('current') dlswLocMacLocalInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 4, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswLocMacLocalInterfaceName.setStatus('current') dlswCircuitTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1), ) if mibBuilder.loadTexts: dlswCircuitTable.setStatus('current') dlswCircuitEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1), ).setIndexNames((0, "A3COM-HUAWEI-SNA-DLSW-MIB", "dlswCircuitS1CircuitId")) if mibBuilder.loadTexts: dlswCircuitEntry.setStatus('current') dlswCircuitS1CircuitId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 1), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: dlswCircuitS1CircuitId.setStatus('current') dlswCircuitS1Mac = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 2), MacAddressNC()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS1Mac.setStatus('current') dlswCircuitS1Sap = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS1Sap.setStatus('current') dlswCircuitS2Mac = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 4), MacAddressNC()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS2Mac.setStatus('current') dlswCircuitS2Sap = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS2Sap.setStatus('current') dlswCircuitS1IfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS1IfIndex.setStatus('current') dlswCircuitS1Ifname = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS1Ifname.setStatus('current') dlswCircuitS1DlcType = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 8), DlcType()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS1DlcType.setStatus('current') dlswCircuitS2Location = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 9), EndStationLocation()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS2Location.setStatus('obsolete') dlswCircuitS2TAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS2TAddress.setStatus('current') dlswCircuitS2CircuitId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitS2CircuitId.setStatus('current') dlswCircuitOrigin = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("s1", 1), ("s2", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitOrigin.setStatus('current') dlswCircuitEntryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 13), TimeTicks()).setUnits('hundredths of a second').setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitEntryTime.setStatus('current') dlswCircuitStateTime = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 14), TimeTicks()).setUnits('hundredths of a second').setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitStateTime.setStatus('current') dlswCircuitState = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=NamedValues(("disconnected", 1), ("circuitStart", 2), ("resolvePending", 3), ("circuitPending", 4), ("circuitEstablished", 5), ("connectPending", 6), ("contactPending", 7), ("connected", 8), ("disconnectPending", 9), ("haltPending", 10), ("haltPendingNoack", 11), ("circuitRestart", 12), ("restartPending", 13)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitState.setStatus('current') dlswCircuitPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unsupported", 1), ("low", 2), ("medium", 3), ("high", 4), ("highest", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitPriority.setStatus('obsolete') dlswCircuitFCSendGrantedUnits = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitFCSendGrantedUnits.setStatus('current') dlswCircuitFCSendCurrentWndw = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitFCSendCurrentWndw.setStatus('current') dlswCircuitFCRecvGrantedUnits = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitFCRecvGrantedUnits.setStatus('current') dlswCircuitFCRecvCurrentWndw = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitFCRecvCurrentWndw.setStatus('current') dlswCircuitFCLargestRecvGranted = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 21), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitFCLargestRecvGranted.setStatus('obsolete') dlswCircuitFCLargestSendGranted = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 5, 1, 1, 22), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswCircuitFCLargestSendGranted.setStatus('obsolete') dlswSdlcPortTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1), ) if mibBuilder.loadTexts: dlswSdlcPortTable.setStatus('current') dlswSdlcPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: dlswSdlcPortEntry.setStatus('current') dlswSdlcPortSerialName = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswSdlcPortSerialName.setStatus('current') dlswSdlcPortEncap = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("sdlc", 1), ("ppp", 2), ("other", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: dlswSdlcPortEncap.setStatus('current') dlswSdlcPortRole = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("primary", 1), ("seconday", 2), ("norole", 3))).clone('norole')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortRole.setStatus('current') dlswSdlcPortVmac = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 4), MacAddressNC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortVmac.setStatus('current') dlswSdlcPortHoldq = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(20, 255)).clone(50)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortHoldq.setStatus('current') dlswSdlcPortK = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 7)).clone(7)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortK.setStatus('current') dlswSdlcPortModule = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(8, 128))).clone(namedValues=NamedValues(("m8", 8), ("m128", 128))).clone('m8')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortModule.setStatus('current') dlswSdlcPortN1 = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 17680)).clone(265)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortN1.setStatus('current') dlswSdlcPortN2 = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(20)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortN2.setStatus('current') dlswSdlcPortPollPauseTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10000)).clone(100)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortPollPauseTimer.setStatus('current') dlswSdlcPortSimultaneousEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disenable", 2))).clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortSimultaneousEnable.setStatus('current') dlswSdlcPortT1 = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000)).clone(3000)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortT1.setStatus('current') dlswSdlcPortT2 = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000)).clone(500)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortT2.setStatus('current') dlswSdlcPortNrziEncoding = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disenable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortNrziEncoding.setStatus('obsolete') dlswSdlcPortIdleMarkEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disenable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcPortIdleMarkEnable.setStatus('obsolete') dlswSdlcLsTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2), ) if mibBuilder.loadTexts: dlswSdlcLsTable.setStatus('current') dlswSdlcLsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-SNA-DLSW-MIB", "dlswSdlcLsAddress")) if mibBuilder.loadTexts: dlswSdlcLsEntry.setStatus('current') dlswSdlcLsAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 254))) if mibBuilder.loadTexts: dlswSdlcLsAddress.setStatus('current') dlswSdlcLsLocalId = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcLsLocalId.setStatus('current') dlswSdlcLsRemoteMac = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2, 1, 3), MacAddressNC()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcLsRemoteMac.setStatus('current') dlswSdlcLsSsap = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 254))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcLsSsap.setStatus('current') dlswSdlcLsDsap = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 254))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcLsDsap.setStatus('current') dlswSdlcLsStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 6, 2, 1, 6), EntryStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswSdlcLsStatus.setStatus('current') dlswLlc2PortTable = MibTable((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1), ) if mibBuilder.loadTexts: dlswLlc2PortTable.setStatus('current') dlswLlc2PortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "A3COM-HUAWEI-SNA-DLSW-MIB", "dlswBridgeIfBriGru")) if mibBuilder.loadTexts: dlswLlc2PortEntry.setStatus('current') dlswLLC2PortAckDelayTime = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000)).clone(100)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortAckDelayTime.setStatus('current') dlswLLC2PortAckMax = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 127)).clone(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortAckMax.setStatus('current') dlswLLC2PortLocalWnd = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 127)).clone(7)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortLocalWnd.setStatus('current') dlswLLC2PortModulus = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(8, 128))).clone(namedValues=NamedValues(("m8", 8), ("m128", 128))).clone('m128')).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortModulus.setStatus('current') dlswLLC2PortN2 = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(20)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortN2.setStatus('current') dlswLLC2PortT1 = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000)).clone(200)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortT1.setStatus('current') dlswLLC2PortTbusyTime = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000)).clone(300)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortTbusyTime.setStatus('current') dlswLLC2PortTpfTime = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000)).clone(500)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortTpfTime.setStatus('current') dlswLLC2PortTrejTime = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 60000)).clone(500)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortTrejTime.setStatus('current') dlswLLC2PortTxqMax = MibTableColumn((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 7, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(20, 200)).clone(50)).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswLLC2PortTxqMax.setStatus('current') dlswTrapControl = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 20)) dlswTrapCntlState = MibScalar((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 1, 20, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: dlswTrapCntlState.setStatus('current') dlswTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 8)) dlswTrapsV2 = MibIdentifier((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 8, 0)) dlswTrapTConnPartnerReject = NotificationType((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 8, 0, 1)).setObjects(("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswRemotePeerAddr")) if mibBuilder.loadTexts: dlswTrapTConnPartnerReject.setStatus('current') dlswTrapTConnChangeState = NotificationType((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 8, 0, 2)).setObjects(("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswRemotePeerAddr"), ("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswRemotePeerLinkState")) if mibBuilder.loadTexts: dlswTrapTConnChangeState.setStatus('current') dlswTrapCircuitChangeState = NotificationType((1, 3, 6, 1, 4, 1, 43, 45, 1, 2, 34, 8, 0, 3)).setObjects(("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswCircuitS1CircuitId"), ("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswCircuitState"), ("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswCircuitS1Mac"), ("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswCircuitS1Sap"), ("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswCircuitS2Mac"), ("A3COM-HUAWEI-SNA-DLSW-MIB", "dlswCircuitS2Sap")) if mibBuilder.loadTexts: dlswTrapCircuitChangeState.setStatus('current') mibBuilder.exportSymbols("A3COM-HUAWEI-SNA-DLSW-MIB", dlswLLC2PortModulus=dlswLLC2PortModulus, dlswLLC2PortTxqMax=dlswLLC2PortTxqMax, dlswBridgeNum=dlswBridgeNum, dlswCircuitS2TAddress=dlswCircuitS2TAddress, dlswRemotePeerRecvPacks=dlswRemotePeerRecvPacks, dlswTrapTConnChangeState=dlswTrapTConnChangeState, dlswNodeMaxWindow=dlswNodeMaxWindow, dlswNode=dlswNode, dlswLlc2=dlswLlc2, dlswRemotePeerLinger=dlswRemotePeerLinger, dlswSdlc=dlswSdlc, dlswCircuitS2Location=dlswCircuitS2Location, dlswBridgeTable=dlswBridgeTable, dlswBridgeStatus=dlswBridgeStatus, LFSize=LFSize, dlswSdlcPortSerialName=dlswSdlcPortSerialName, dlswRemotePeerBackupAddr=dlswRemotePeerBackupAddr, dlswSdlcPortTable=dlswSdlcPortTable, dlswNodeVirtualSegmentLFSize=dlswNodeVirtualSegmentLFSize, dlswRemotePeerAddr=dlswRemotePeerAddr, dlswCircuitS1Sap=dlswCircuitS1Sap, dlswRemotePeerNumOfTcpSessions=dlswRemotePeerNumOfTcpSessions, dlswLocMacTable=dlswLocMacTable, dlswCircuitS1IfIndex=dlswCircuitS1IfIndex, dlswRemotePeerLinkState=dlswRemotePeerLinkState, dlswSdlcPortVmac=dlswSdlcPortVmac, dlswNodeStdPacingSupport=dlswNodeStdPacingSupport, PYSNMP_MODULE_ID=dlsw, dlswCircuitS1Ifname=dlswCircuitS1Ifname, dlswRemotePeerSetStateToConfig=dlswRemotePeerSetStateToConfig, dlswCircuitFCRecvCurrentWndw=dlswCircuitFCRecvCurrentWndw, dlswRemotePeerIsConfig=dlswRemotePeerIsConfig, dlswSdlcPortRole=dlswSdlcPortRole, dlswCircuitS1CircuitId=dlswCircuitS1CircuitId, DlcType=DlcType, dlswRemotePeerKeepAlive=dlswRemotePeerKeepAlive, dlswLLC2PortLocalWnd=dlswLLC2PortLocalWnd, dlswSdlcLsAddress=dlswSdlcLsAddress, dlswNodeRemotePendTimeout=dlswNodeRemotePendTimeout, dlswRemotePeerHaveBackup=dlswRemotePeerHaveBackup, dlswLLC2PortTrejTime=dlswLLC2PortTrejTime, dlswCircuitFCLargestSendGranted=dlswCircuitFCLargestSendGranted, dlswNodeSnaCacheTimeout=dlswNodeSnaCacheTimeout, dlswNodeLocalPendTimeout=dlswNodeLocalPendTimeout, dlswNodeStatus=dlswNodeStatus, dlswCircuitStateTime=dlswCircuitStateTime, dlswNodeKeepAlive=dlswNodeKeepAlive, dlswSdlcPortIdleMarkEnable=dlswSdlcPortIdleMarkEnable, dlswRemotePeerVersion=dlswRemotePeerVersion, CreateLineFlag=CreateLineFlag, dlswRemotePeerEntry=dlswRemotePeerEntry, dlswRemotePeerSendPacks=dlswRemotePeerSendPacks, dlswNodeVersionString=dlswNodeVersionString, EntryStatus=EntryStatus, dlswCircuitFCLargestRecvGranted=dlswCircuitFCLargestRecvGranted, dlswNodeUpTime=dlswNodeUpTime, dlswNodeVendorID=dlswNodeVendorID, dlswCircuitPriority=dlswCircuitPriority, dlswNodeVersion=dlswNodeVersion, dlswSdlcPortEncap=dlswSdlcPortEncap, dlswLlc2PortTable=dlswLlc2PortTable, dlswLLC2PortAckDelayTime=dlswLLC2PortAckDelayTime, dlswLLC2PortN2=dlswLLC2PortN2, dlswBridgeIfTable=dlswBridgeIfTable, dlswRemotePeerTable=dlswRemotePeerTable, dlswCircuitEntry=dlswCircuitEntry, dlswCircuitFCSendGrantedUnits=dlswCircuitFCSendGrantedUnits, dlswLLC2PortTpfTime=dlswLLC2PortTpfTime, dlswRemotePeerPaceWindInit=dlswRemotePeerPaceWindInit, dlswRemotePeerIsBackup=dlswRemotePeerIsBackup, dlswCircuitS2Sap=dlswCircuitS2Sap, dlswLLC2PortAckMax=dlswLLC2PortAckMax, dlswLocMacHashIndex=dlswLocMacHashIndex, dlswTrapCircuitChangeState=dlswTrapCircuitChangeState, dlswTConn=dlswTConn, dlswCircuitOrigin=dlswCircuitOrigin, dlswLlc2PortEntry=dlswLlc2PortEntry, dlswCircuitState=dlswCircuitState, dlswCircuitS1Mac=dlswCircuitS1Mac, dlswSdlcLsEntry=dlswSdlcLsEntry, dlswCircuitEntryTime=dlswCircuitEntryTime, dlswSdlcLsStatus=dlswSdlcLsStatus, dlswCircuitS2CircuitId=dlswCircuitS2CircuitId, dlswLLC2PortTbusyTime=dlswLLC2PortTbusyTime, dlswRemotePeerTcpQueneMax=dlswRemotePeerTcpQueneMax, dlswCircuit=dlswCircuit, dlswBridgeEntry=dlswBridgeEntry, dlswSdlcPortEntry=dlswSdlcPortEntry, dlswRemotePeerDrops=dlswRemotePeerDrops, dlswCircuitTable=dlswCircuitTable, dlswNodePermitDynamic=dlswNodePermitDynamic, dlswRemotePeerVendorID=dlswRemotePeerVendorID, dlswSdlcPortModule=dlswSdlcPortModule, dlsw=dlsw, dlswSdlcLsSsap=dlswSdlcLsSsap, dlswCircuitFCRecvGrantedUnits=dlswCircuitFCRecvGrantedUnits, dlswSdlcPortSimultaneousEnable=dlswSdlcPortSimultaneousEnable, dlswSdlcLsTable=dlswSdlcLsTable, dlswTrapControl=dlswTrapControl, dlswSdlcLsLocalId=dlswSdlcLsLocalId, dlswBridgeIfBriGru=dlswBridgeIfBriGru, dlswRemotePeerUptime=dlswRemotePeerUptime, dlswTraps=dlswTraps, dlswNodeConnTimeout=dlswNodeConnTimeout, dlswTrapCntlState=dlswTrapCntlState, dlswTrapsV2=dlswTrapsV2, MacAddressNC=MacAddressNC, dlswSdlcPortN2=dlswSdlcPortN2, dlswLocMacLocalInterfaceName=dlswLocMacLocalInterfaceName, dlswNodeInitWindow=dlswNodeInitWindow, dlswTrapTConnPartnerReject=dlswTrapTConnPartnerReject, dlswSdlcPortN1=dlswSdlcPortN1, dlswRemotePeerCost=dlswRemotePeerCost, dlswSdlcPortPollPauseTimer=dlswSdlcPortPollPauseTimer, dlswSdlcPortK=dlswSdlcPortK, EndStationLocation=EndStationLocation, dlswRemotePeerLf=dlswRemotePeerLf, dlswBridgeIfEntry=dlswBridgeIfEntry, dlswSdlcLsRemoteMac=dlswSdlcLsRemoteMac, dlswSdlcPortHoldq=dlswSdlcPortHoldq, dlswLLC2PortT1=dlswLLC2PortT1, dlswLocMacHashIndexSeqNum=dlswLocMacHashIndexSeqNum, dlswSdlcPortT1=dlswSdlcPortT1, dlswSdlcPortT2=dlswSdlcPortT2, dlswLocMacMac=dlswLocMacMac, dlswRemotePeerEntryStatus=dlswRemotePeerEntryStatus, dlswBridgeGroup=dlswBridgeGroup, dlswNodePriority=dlswNodePriority, dlswSdlcPortNrziEncoding=dlswSdlcPortNrziEncoding, dlswLocMacEntry=dlswLocMacEntry, dlswBridgeIfStatus=dlswBridgeIfStatus, dlswCircuitS2Mac=dlswCircuitS2Mac, dlswBridgeIfName=dlswBridgeIfName, dlswSdlcLsDsap=dlswSdlcLsDsap, dlswCircuitS1DlcType=dlswCircuitS1DlcType, dlswNodeLocalAddr=dlswNodeLocalAddr, dlswCircuitFCSendCurrentWndw=dlswCircuitFCSendCurrentWndw, dlswLocDirectory=dlswLocDirectory, dlswRemotePeerVersionString=dlswRemotePeerVersionString)
131.249169
5,640
0.75505
88f5b3a545f8379f5c6bd871ff166dd1442dd335
1,263
py
Python
solutions/validate-binary-search-tree.py
edab/-LC_StudyPlan_Python
e065f0ced68d23800d7b5001102c2e930ee35e23
[ "MIT" ]
null
null
null
solutions/validate-binary-search-tree.py
edab/-LC_StudyPlan_Python
e065f0ced68d23800d7b5001102c2e930ee35e23
[ "MIT" ]
1
2022-02-22T15:42:54.000Z
2022-02-25T00:10:04.000Z
solutions/validate-binary-search-tree.py
edab/-LC_StudyPlan_Python
e065f0ced68d23800d7b5001102c2e930ee35e23
[ "MIT" ]
null
null
null
# Leetcode 98. Validate Binary Search Tree # # Link: https://leetcode.com/problems/validate-binary-search-tree/ # Difficulty: Medium # Complexity: # O(N) time | where N represent the number of elements in the input tree # O(N) space | where N represent the number of elements in the input tree # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right
30.071429
104
0.63658
88f8317bf62d16d93d0f7dd37a85760c1a1014e1
763
py
Python
setup.py
stanford-ccb/ccb
ba75d490663958703f19e7a13f72001b050da229
[ "MIT" ]
3
2020-02-13T00:49:06.000Z
2020-06-24T23:53:25.000Z
setup.py
stanford-ccb/ccb
ba75d490663958703f19e7a13f72001b050da229
[ "MIT" ]
null
null
null
setup.py
stanford-ccb/ccb
ba75d490663958703f19e7a13f72001b050da229
[ "MIT" ]
4
2020-01-29T17:21:59.000Z
2021-01-27T01:53:05.000Z
from setuptools import setup version = open("ccb/__version__.py").read().strip('"\n') setup_args = { "name": "ccb", "version": version, "url": "https://github.com/earth-chris/ccb", "license": "MIT", "author": "Christopher Anderson", "author_email": "cbanders@stanford.edu", "description": "Species distribution modeling support tools", "keywords": ["maxent", "biogeography", "SDM", "species distribution modeling", "ecologyy", "conservation"], "packages": ["ccb"], "include_package_data": True, "platforms": "any", "scripts": ["bin/gbif-to-vector.py", "bin/vector-to-maxent.py"], "data_files": [("maxent", ["ccb/maxent/maxent.jar", "ccb/maxent/README.txt", "ccb/maxent/LICENSE.txt"])], } setup(**setup_args)
34.681818
111
0.643512
88f8e7ad2c848fa7633da12c05df70cdb4d3835a
1,576
py
Python
Unit4/Lesson8.py
szhua/PythonLearn
12eaf7cc74a0310bb23e21773f3c83deb91d0362
[ "Apache-2.0" ]
null
null
null
Unit4/Lesson8.py
szhua/PythonLearn
12eaf7cc74a0310bb23e21773f3c83deb91d0362
[ "Apache-2.0" ]
null
null
null
Unit4/Lesson8.py
szhua/PythonLearn
12eaf7cc74a0310bb23e21773f3c83deb91d0362
[ "Apache-2.0" ]
null
null
null
# import time # # def reader(): # """A generator that fakes a read from a file, socket, etc.""" # for i in range(101): # yield '<< %s' % i # # def consumer(): # r = '' # while True: # #Pythonyield # #n # n = yield from reader() # print("===",n) # if not n: # return # print('[CONSUMER] Consuming %s...' % n) # r = '200 OK' # # def produce(c): # c.send(None) # n = 0 # while n < 100: # n = n + 1 # print('[PRODUCER] Producing %s...' % n) # r = c.send(n) # print('[PRODUCER] Consumer return: %s' % r) # c.close() # # c = consumer() # produce(c) # def getIN(): # for x in range(1000): # n = yield x # print(n,"--rer",x) # # ge =getIN() # # # # ge.send(None) # ge.send("11") # ge.send("222") tallies = [] acc = gather_tallies(tallies) next(acc) # for i in range(4): acc.send(i) acc.send(None) # for i in range(5): acc.send(i) acc.send(None) # print(tallies) for x in get(): print(x)
17.909091
68
0.498096
88fb6794a48a5fc109dca145fcd71d6498bacc28
1,288
py
Python
tools/transferComponentSelection.py
fsanges/glTools
8ff0899de43784a18bd4543285655e68e28fb5e5
[ "MIT" ]
165
2015-01-26T05:22:04.000Z
2022-03-22T02:50:41.000Z
tools/transferComponentSelection.py
qeeji/glTools
8ff0899de43784a18bd4543285655e68e28fb5e5
[ "MIT" ]
5
2015-12-02T02:39:44.000Z
2020-12-09T02:45:54.000Z
tools/transferComponentSelection.py
qeeji/glTools
8ff0899de43784a18bd4543285655e68e28fb5e5
[ "MIT" ]
83
2015-02-10T17:18:24.000Z
2022-02-10T07:16:47.000Z
import maya.cmds as mc import maya.OpenMaya as OpenMaya import glTools.utils.base def transferComponentSelection(sourceSelection,targetMesh,threshold=0.0001): ''' ''' # Check selection target mesh if not mc.objExists(targetMesh): raise Exception('Target mesh "'+targetMesh+'" does not exist!') # Flatten selection sourceSelection = mc.ls(sourceSelection,fl=True) # Get mesh points tPtArray = glTools.utils.base.getMPointArray(targetMesh) tPtLen = tPtArray.length() # Initialize component selection transfer list tPtBool = [False for i in range(tPtLen)] # Initialize selection list tSel = [] # Transfer selection for sel in sourceSelection: # Get selection point pt = mc.pointPosition(sel) pt = OpenMaya.MPoint(pt[0],pt[1],pt[2],1.0) # Find closest component cDist = 99999 cIndex = -1 for i in range(tPtLen): # Check component selection transfer list if tPtBool[i]: continue # Check distance to current point dist = (pt-tPtArray[i]).length() if dist < cDist: cDist = dist cIndex = i # Test threshold if dist < threshold: break # Append selection tSel.append(targetMesh+'.vtx['+str(cIndex)+']') # Update component selection transfer list tPtBool[i] = True # Return result return tSel
22.596491
76
0.699534
88fcbd1db9da3e509077f5b7cc6ecfe05a708ea8
3,289
py
Python
pyprika/__init__.py
muppetize/pyprika
c1a4c086ee99935f5e7cf7361a4552fe69fe4b44
[ "MIT" ]
7
2016-03-10T22:23:28.000Z
2021-01-17T03:25:50.000Z
pyprika/__init__.py
muppetize/pyprika
c1a4c086ee99935f5e7cf7361a4552fe69fe4b44
[ "MIT" ]
1
2017-01-19T21:35:23.000Z
2017-01-27T04:11:44.000Z
pyprika/__init__.py
muppetize/pyprika
c1a4c086ee99935f5e7cf7361a4552fe69fe4b44
[ "MIT" ]
4
2016-11-19T21:48:41.000Z
2022-02-18T01:23:23.000Z
""" A Python package for recipe parsing and management. """ import yaml try: from cStringIO import StringIO except ImportError: from io import StringIO from .exceptions import LoadError, ParseError, PyprikaError, FieldError # noqa from .ingredient import Ingredient # noqa from .quantity import Quantity # noqa from .recipe import Recipe from .version import __author__, __version__ # noqa def load(fp, loader=None, **kw): """ Load ``fp``, a file-like object The file is assumed to be a pyprika-compliant YAML document. If the document contains a sequence, a list of ``Recipe`` objects will be returned. Otherwise, a single ``Recipe`` object should be returned. Note that this function wraps the underlying exceptions thrown by :meth:`Recipe.from_dict` under the assumption it is due to a malformed document, but the original traceback is preserved. :param file-like fp: the file-like object containing the document to load :param callable loader: takes one positional argument and optional arguments and returns a dict (defaults to ``yaml.load``) :param kw: passed through to loader :raises LoadError: if there was an error in the loading of the document, usually indicative of a syntax error :returns: the recipe data contained in the stream :rtype: :class:`Recipe` or list of :class:`Recipe` """ loader = loader or yaml.load try: d = loader(fp) if isinstance(d, (tuple, list)): return [Recipe.from_dict(x) for x in d] elif isinstance(d, dict): return Recipe.from_dict(d) else: raise LoadError('Recipe did not decode as expected (got %s)' % type(d).__name__) except PyprikaError as e: raise LoadError(*e.args, cause=e) def loads(data, loader=None, **kw): """ Load recipe from string data. This wraps ``data`` in a :class:`cString.StringIO` and calls :func:`load` on it. See :func:`load` for more information. :param str data: recipe document data :returns: the recipe data contained in ``data`` :rtype: :class:`Recipe` or list of :class:`Recipe` """ return load(StringIO(data), loader=loader, **kw) def dump(recipe, fp, dumper=None, **kw): """ Dump recipe to a file-like object :param Recipe recipe: the recipe to dump :param file-like fp: the file stream to dump to :param callable dumper: a callable which takes two positional arguments, the first a dict and the second a file stream, and optional keyword arguments and encodes the recipe to the file stream (defaults to yaml.dump) :param kw: passed through to dumper """ dumper = dumper or yaml.dump d = recipe.to_dict(serialize=True) dumper(d, fp, **kw) def dumps(recipe, dumper=None, **kw): """ Dump recipe object as a string. This is a convenience method to dump to a StringIO object. See :func:`dump` for parameter details. :returns: recipe encoded as a string :rtype: str """ fp = StringIO() dump(recipe, fp, dumper=dumper, **kw) return fp.getvalue()
33.907216
79
0.644573
88fcc966d96adb9a2926e13a38e7ae9f04bcd664
1,202
py
Python
tests/molecular/molecules/constructed_molecule/test_get_bond_infos.py
stevenbennett96/stk
6e5af87625b83e0bfc7243bc42d8c7a860cbeb76
[ "MIT" ]
21
2018-04-12T16:25:24.000Z
2022-02-14T23:05:43.000Z
tests/molecular/molecules/constructed_molecule/test_get_bond_infos.py
stevenbennett96/stk
6e5af87625b83e0bfc7243bc42d8c7a860cbeb76
[ "MIT" ]
8
2019-03-19T12:36:36.000Z
2020-11-11T12:46:00.000Z
tests/molecular/molecules/constructed_molecule/test_get_bond_infos.py
stevenbennett96/stk
6e5af87625b83e0bfc7243bc42d8c7a860cbeb76
[ "MIT" ]
5
2018-08-07T13:00:16.000Z
2021-11-01T00:55:10.000Z
def test_get_bond_infos(case_data): """ Test :meth:`.ConstructedMolecule.get_bond_infos`. Parameters ---------- case_data : :class:`.CaseData` A test case. Holds the constructed molecule to test and the correct number of new bonds. Returns ------- None : :class:`NoneType` """ _test_get_bond_infos( constructed_molecule=case_data.constructed_molecule, num_new_bonds=case_data.num_new_bonds, ) def _test_get_bond_infos(constructed_molecule, num_new_bonds): """ Test :meth:`.ConstructedMolecule.get_bond_infos`. Parameters ---------- constructed_molecule : :class:`.ConstructedMolecule` The constructed molecule to test. num_new_bonds : :class:`int` The correct number of new bonds added. Returns ------- None : :class:`NoneType` """ new_bonds = filter( lambda bond_info: bond_info.get_building_block() is None, constructed_molecule.get_bond_infos(), ) assert sum(1 for _ in new_bonds) == num_new_bonds assert ( constructed_molecule.get_num_bonds() == sum(1 for _ in constructed_molecule.get_bond_infos()) )
23.568627
67
0.645591
88fd1341d14bed024a3961fac8b9b61a8a5de30e
94
py
Python
generic_views/base_views/apps.py
markbirds/Django-Code-Repo
b55762d2dab00640acf2e8e00ddc66716d53c6b5
[ "MIT" ]
1
2021-11-25T00:02:36.000Z
2021-11-25T00:02:36.000Z
generic_views/base_views/apps.py
markbirds/Django-Code-Repo
b55762d2dab00640acf2e8e00ddc66716d53c6b5
[ "MIT" ]
null
null
null
generic_views/base_views/apps.py
markbirds/Django-Code-Repo
b55762d2dab00640acf2e8e00ddc66716d53c6b5
[ "MIT" ]
null
null
null
from django.apps import AppConfig
15.666667
33
0.765957
88fe054080de49b8785340e2f3ce23ac82e4a3fa
324
py
Python
the_office/test.py
zubyjaved/reddit-bots
9f15f5ee9eede5223c975c29527c9e58d68bb517
[ "MIT" ]
2
2019-09-07T09:40:23.000Z
2021-06-19T08:40:00.000Z
the_office/test.py
zubyjaved/reddit-bots
9f15f5ee9eede5223c975c29527c9e58d68bb517
[ "MIT" ]
2
2019-09-05T04:42:23.000Z
2019-09-05T04:44:37.000Z
the_office/test.py
zubyjaved/reddit-bots
9f15f5ee9eede5223c975c29527c9e58d68bb517
[ "MIT" ]
null
null
null
import json import praw reddit = praw.Reddit("dwight-schrute-bot") for submission in reddit.subreddit('all').rising(limit=15): submission.comments.replace_more(limit=None) print(submission.subreddit.display_name) if not submission.over_18: for comment in submission.comments.list(): print()
29.454545
59
0.722222
88fe820e78b74b43c84647fdd224db13efd8f585
1,311
py
Python
Scripts/Client/ManualControlTest.py
Fzeak/sauvc-2019
573dcb351d0f87f9b7605667c570a5003bedb224
[ "MIT" ]
null
null
null
Scripts/Client/ManualControlTest.py
Fzeak/sauvc-2019
573dcb351d0f87f9b7605667c570a5003bedb224
[ "MIT" ]
null
null
null
Scripts/Client/ManualControlTest.py
Fzeak/sauvc-2019
573dcb351d0f87f9b7605667c570a5003bedb224
[ "MIT" ]
null
null
null
from pymavlink import mavutil import time # Create the connection master = mavutil.mavlink_connection('udpin:0.0.0.0:14550') # Wait a heartbeat before sending commands master.wait_heartbeat() # Send a positive x value, negative y, negative z, # positive rotation and no button. # http://mavlink.org/messages/common#MANUAL_CONTROL # Warning: Because of some legacy workaround, z will work between [0-1000] # where 0 is full reverse, 500 is no output and 1000 is full throttle. # x,y and r will be between [-1000 and 1000]. master.mav.manual_control_send( master.target_system, 500, -500, 250, 500, 0) # To active button 0 (first button), 3 (fourth button) and 7 (eighth button) # It's possible to check and configure this buttons in the Joystick menu of QGC buttons = 1 + 1 << 3 + 1 << 7 master.mav.manual_control_send( master.target_system, 0, 0, 0, 0, buttons) # Request all parameters master.mav.param_request_list_send( master.target_system, master.target_component ) while True: time.sleep(0.01) try: message = master.recv_match(type='PARAM_VALUE', blocking=True).to_dict() print('name: %s\tvalue: %d' % (message['param_id'].decode("utf-8"), message['param_value'])) except Exception as e: print(e) exit(0)
28.5
100
0.695652
88febcb95df370f538bcc67acef3a199df882aef
1,734
py
Python
HEIC en JPG.py
PictorSomni/Image_manipulations
7b91dd8514a2bb4383308c199e03e26539cef430
[ "MIT" ]
null
null
null
HEIC en JPG.py
PictorSomni/Image_manipulations
7b91dd8514a2bb4383308c199e03e26539cef430
[ "MIT" ]
null
null
null
HEIC en JPG.py
PictorSomni/Image_manipulations
7b91dd8514a2bb4383308c199e03e26539cef430
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ############################################################# # IMPORTS # ############################################################# import os from PIL import Image import pyheif ############################################################# # PATH # ############################################################# PATH = os.path.dirname(os.path.abspath(__file__)) os.chdir(PATH) ############################################################# # CONTENT # ############################################################# ImageFile.LOAD_TRUNCATED_IMAGES = True EXTENSION = (".heic", ".HEIC") FOLDER = [file for file in sorted(os.listdir()) if file.endswith(EXTENSION)] TOTAL = len(FOLDER) ############################################################# # MAIN # ############################################################# for i, file in enumerate(FOLDER) : filename, file_extension = os.path.splitext(file) try : heif_file = pyheif.read(file) except Exception : print(Exception) else : if not os.path.exists(PATH + "/JPG") : os.makedirs(PATH + "/JPG") image = Image.frombytes( heif_file.mode, heif_file.size, heif_file.data, "raw", heif_file.mode, heif_file.stride, ) image = image.convert("RGB") image.save(f"{PATH}/JPG/{filename}.jpg", dpi=(DPI, DPI), format='JPEG', subsampling=0, quality=100)
36.893617
107
0.336794
88ffda9c63fb74eb6eeb58819eb9951a55e13efa
17,863
py
Python
tplbuild/config.py
msg555/tplbuild
1517fa97b17df4883f6885a7fb3ccfe017576e53
[ "BSD-3-Clause" ]
null
null
null
tplbuild/config.py
msg555/tplbuild
1517fa97b17df4883f6885a7fb3ccfe017576e53
[ "BSD-3-Clause" ]
null
null
null
tplbuild/config.py
msg555/tplbuild
1517fa97b17df4883f6885a7fb3ccfe017576e53
[ "BSD-3-Clause" ]
null
null
null
import functools import os import ssl import uuid from typing import Any, Dict, List, Literal, Optional, Tuple import jinja2 import pydantic import yaml from .exceptions import TplBuildException, TplBuildTemplateException RESERVED_PROFILE_KEYS = { "begin_stage", "platform", } def _normalize_rel_path(path: str) -> str: """Normalize and coerce a path into a relative path.""" return f".{os.path.sep}{os.path.normpath(os.path.join(os.path.sep, path))[1:]}" UNSET_CLIENT_CONFIG = ClientConfig( build=ClientCommand(template=""), tag=ClientCommand(template=""), push=ClientCommand(template=""), untag=ClientCommand(template=""), )
40.141573
96
0.666014
00002c1133ee1a3e69c2c023cddb9b34c36440ca
1,634
py
Python
setup.py
DNA-and-Natural-Algorithms-Group/peppercompiler
effbcdedfb17534300fb3504a552e46c1ead41e4
[ "MIT" ]
3
2019-06-10T18:44:03.000Z
2021-11-17T10:57:09.000Z
setup.py
DNA-and-Natural-Algorithms-Group/peppercompiler
effbcdedfb17534300fb3504a552e46c1ead41e4
[ "MIT" ]
2
2017-12-15T01:09:49.000Z
2021-03-25T20:42:23.000Z
setup.py
DNA-and-Natural-Algorithms-Group/peppercompiler
effbcdedfb17534300fb3504a552e46c1ead41e4
[ "MIT" ]
4
2017-08-21T03:32:51.000Z
2019-10-18T04:09:38.000Z
#!/usr/bin/env python from setuptools import setup from distutils.command.build import build from setuptools.command.develop import develop setup( name="peppercompiler", version="0.1.3", packages=['peppercompiler', 'peppercompiler.design'], install_requires=["pyparsing", "six"], include_package_data=True, package_data={ 'peppercompiler': ['_spuriousSSM', 'SpuriousDesign/spuriousSSM.c'] }, test_suite='peppercompiler.tests', cmdclass={'build': build_with_spurious, 'develop': develop_with_spurious}, entry_points={ 'console_scripts': [ 'pepper-compiler = peppercompiler.compiler:main', 'pepper-design-spurious = peppercompiler.design.spurious_design:main', 'pepper-finish = peppercompiler.finish:main', 'spuriousSSM = peppercompiler._spuriousSSM_wrapper:main' ] }, author="Constantine Evans et al (this version)", author_email="cge@dna.caltech.edu", description="PepperCompiler in a pythonic form")
29.709091
106
0.641983
00004b28f6ae2b9a9b673b26fbf0fba70c90416d
1,126
py
Python
client/client.py
flavioribeiro/playmobil
d104b80fd666158e7ae3d1e28ce8d3ba68e93a68
[ "Apache-2.0" ]
1
2016-10-27T21:30:30.000Z
2016-10-27T21:30:30.000Z
client/client.py
flavioribeiro/playmobil
d104b80fd666158e7ae3d1e28ce8d3ba68e93a68
[ "Apache-2.0" ]
null
null
null
client/client.py
flavioribeiro/playmobil
d104b80fd666158e7ae3d1e28ce8d3ba68e93a68
[ "Apache-2.0" ]
null
null
null
import sys sys.path.append("/Library/Frameworks/GStreamer.framework/Versions/0.10/lib/python2.7/site-packages/") import gobject gobject.threads_init() import pygst pygst.require("0.10") import gst client = Client() client.start() loop = gobject.MainLoop() loop.run()
34.121212
101
0.71492
00005f4a70c5144076952dbbb1c77de24a5e43d7
3,852
py
Python
InternetSemLimites/api/tests/test_edit_view.py
InternetSemLimites/PublicAPI
3dd0f17fe66688ef2895de540950f45d69bcd9d8
[ "MIT" ]
18
2016-04-14T17:03:29.000Z
2020-01-01T00:54:03.000Z
InternetSemLimites/api/tests/test_edit_view.py
InternetSemLimites/PublicAPI
3dd0f17fe66688ef2895de540950f45d69bcd9d8
[ "MIT" ]
48
2016-04-15T12:33:33.000Z
2018-01-25T16:01:45.000Z
InternetSemLimites/api/tests/test_edit_view.py
InternetSemLimites/PublicAPI
3dd0f17fe66688ef2895de540950f45d69bcd9d8
[ "MIT" ]
4
2016-04-15T07:57:04.000Z
2017-09-10T18:10:40.000Z
from django.contrib.auth.models import User from django.core import mail from django.shortcuts import resolve_url from django.test import TestCase from InternetSemLimites.core.forms import ProviderForm from InternetSemLimites.core.models import Provider, State
39.306122
98
0.637072
000066c365ae5f522b2bf93ad57e924347136b00
2,780
py
Python
expr_parse_tree.py
PlaskED/z3-python
e433af3ce7ebc9547630e4528ce6d38d1a5aefd6
[ "MIT" ]
null
null
null
expr_parse_tree.py
PlaskED/z3-python
e433af3ce7ebc9547630e4528ce6d38d1a5aefd6
[ "MIT" ]
null
null
null
expr_parse_tree.py
PlaskED/z3-python
e433af3ce7ebc9547630e4528ce6d38d1a5aefd6
[ "MIT" ]
null
null
null
from z3 import * CONNECTIVE_OPS = [Z3_OP_NOT,Z3_OP_AND,Z3_OP_OR,Z3_OP_IMPLIES,Z3_OP_IFF,Z3_OP_ITE] REL_OPS = [Z3_OP_EQ,Z3_OP_LE,Z3_OP_LT,Z3_OP_GE,Z3_OP_GT] OPERATORS = CONNECTIVE_OPS + REL_OPS # var is tuple (type, name) # creates a constraint which allow only key variable to change # Returns root of constructed tree def constructTree(variables, expr): root = Node(expr) print "constructing tree from ", expr for child in expr.children(): root.insert(child) s = Solver() return root variables = {x[1]:createVar(x) for x in [['bool','A'], ['bool','B'], ['bool','C']]} expr = createExpression(variables, "And(Or(v['A'],v['B']), v['C'])") r = constructTree(variables, expr) r.printTree()
24.60177
83
0.614748
000069dbeffca39b13535cbec664af30b8b425d2
351
py
Python
algorithm-study/therory/selectionSort.py
Seongkyun-Yu/TIL
2be6a2a68246bc98996b1421e2cc20e025c876ed
[ "MIT" ]
1
2020-02-17T15:15:55.000Z
2020-02-17T15:15:55.000Z
algorithm-study/therory/selectionSort.py
Seongkyun-Yu/TIL
2be6a2a68246bc98996b1421e2cc20e025c876ed
[ "MIT" ]
6
2020-07-31T17:03:56.000Z
2022-02-27T04:17:57.000Z
algorithm-study/therory/selectionSort.py
Seongkyun-Yu/TIL
2be6a2a68246bc98996b1421e2cc20e025c876ed
[ "MIT" ]
null
null
null
import random data_list = random.sample(range(100), 50) print(selectionSort(data_list))
18.473684
42
0.65812
00021f532b1a8ddd0a8c15783c8737edde030453
12,045
py
Python
platform/core/polyaxon/monitor_statuses/monitor.py
hackerwins/polyaxon
ff56a098283ca872abfbaae6ba8abba479ffa394
[ "Apache-2.0" ]
null
null
null
platform/core/polyaxon/monitor_statuses/monitor.py
hackerwins/polyaxon
ff56a098283ca872abfbaae6ba8abba479ffa394
[ "Apache-2.0" ]
null
null
null
platform/core/polyaxon/monitor_statuses/monitor.py
hackerwins/polyaxon
ff56a098283ca872abfbaae6ba8abba479ffa394
[ "Apache-2.0" ]
null
null
null
import logging from typing import Any, Mapping import redis import conf import ocular import workers from constants.experiment_jobs import get_experiment_job_uuid from db.redis.containers import RedisJobContainers from db.redis.statuses import RedisStatuses from lifecycles.jobs import JobLifeCycle from options.registry.container_names import ( CONTAINER_NAME_BUILD_JOBS, CONTAINER_NAME_EXPERIMENT_JOBS, CONTAINER_NAME_JOBS, CONTAINER_NAME_PLUGIN_JOBS, CONTAINER_NAME_PYTORCH_JOBS, CONTAINER_NAME_TF_JOBS ) from options.registry.spawner import ( APP_LABELS_DOCKERIZER, APP_LABELS_EXPERIMENT, APP_LABELS_JOB, APP_LABELS_NOTEBOOK, APP_LABELS_TENSORBOARD, ROLE_LABELS_DASHBOARD, ROLE_LABELS_WORKER, TYPE_LABELS_RUNNER ) from options.registry.ttl import TTL_WATCH_STATUSES from polyaxon.settings import K8SEventsCeleryTasks logger = logging.getLogger('polyaxon.monitors.statuses')
39.491803
94
0.594687
0003b8ab877e0ee926932cb4211e0799fd7d5511
14,636
py
Python
flow65/wing_tool.py
corygoates/Flow65
148eddaeeed8711eae37a16820215c89f93f01d5
[ "MIT" ]
null
null
null
flow65/wing_tool.py
corygoates/Flow65
148eddaeeed8711eae37a16820215c89f93f01d5
[ "MIT" ]
null
null
null
flow65/wing_tool.py
corygoates/Flow65
148eddaeeed8711eae37a16820215c89f93f01d5
[ "MIT" ]
null
null
null
import sys import json import numpy as np import matplotlib.pyplot as plt if __name__=="__main__": # Read in input input_file = sys.argv[-1] with open(input_file, 'r') as input_handle: input_dict = json.load(input_handle) # Initialize wing wing_dict = input_dict["wing"] washout_dict = input_dict["wing"]["washout"] aileron_dict = input_dict["wing"]["aileron"] wing = Wing(planform=wing_dict["planform"]["type"], AR=wing_dict["planform"]["aspect_ratio"], RT=wing_dict["planform"].get("taper_ratio"), CL_a_section=wing_dict["airfoil_lift_slope"], washout=washout_dict["distribution"], washout_mag=washout_dict["magnitude[deg]"], washout_CLd=washout_dict["CL_design"], aileron_lims=[aileron_dict["begin[z/b]"], aileron_dict["end[z/b]"]], aileron_cf=[aileron_dict["begin[cf/c]"], aileron_dict["end[cf/c]"]], aileron_hinge_eff=aileron_dict["hinge_efficiency"]) # Set up grid wing.set_grid(wing_dict["nodes_per_semispan"]) # Set condition cond_dict = input_dict["condition"] wing.set_condition(alpha=cond_dict["alpha_root[deg]"], da=cond_dict["aileron_deflection[deg]"], p_bar=cond_dict["pbar"]) # Solve wing.solve() print() print("Wing") print(" Type: {0}".format(wing._planform_type)) print(" Aspect Ratio: {0}".format(wing._AR)) try: print(" Taper Ratio: {0}".format(wing._RT)) except AttributeError: pass print(" Nodes: {0}".format(wing._N)) print() print("Condition") print(" Alpha: {0} deg".format(np.degrees(wing._alpha))) print(" p_bar: {0}".format(wing.p_bar)) print() print("Aerodynamic Coefficients") print(" CL: {0}".format(wing.CL)) print(" CD_i (without roll and aileron effects): {0}".format(wing.CD_i_simp)) print(" CD_i (with roll and airleron effects): {0}".format(wing.CD_i)) print(" Cl: {0}".format(wing.Cl)) print(" Cn: {0}".format(wing.Cn)) print() print("Planform Effects") print(" CL,a: {0}".format(wing.CL_a)) print(" K_L: {0}".format(wing.K_L)) print(" K_D: {0}".format(wing.K_D)) print(" Span efficiency: {0}".format(wing.e_s)) print() print("Washout Effects") print(" Washout effectiveness: {0}".format(wing.e_omega)) print(" K_DL: {0}".format(wing.K_DL)) print(" Washout contribution to induced drag: {0}".format(wing.K_Domega)) print(" K_Do: {0}".format(wing.K_Do)) print() print("Aileron Effects") print(" Cl,da: {0}".format(wing.Cl_da)) print() print("Roll Effects") print(" Cl,p: {0}".format(wing.Cl_p)) # Check for plot requests if input_dict["view"]["planform"]: wing.plot_planform() if input_dict["view"]["washout_distribution"]: wing.plot_washout() if input_dict["view"]["aileron_distribution"]: wing.plot_aileron() # Write solution with open("Solution.txt", 'w') as f: C_str = np.array2string(wing._C) C_inv_str = np.array2string(wing._C_inv) a_n_str = np.array2string(wing._a_n) b_n_str = np.array2string(wing._b_n) c_n_str = np.array2string(wing._c_n) d_n_str = np.array2string(wing._d_n) print("C array", file=f) print(C_str, file=f) print("C_inv array", file=f) print(C_inv_str, file=f) print("a_n", file=f) print(a_n_str, file=f) print("b_n", file=f) print(b_n_str, file=f) print("c_n", file=f) print(c_n_str, file=f) print("d_n", file=f) print(d_n_str, file=f)
36.227723
197
0.583903
000445b6df45545c85a37ba990d9f92d918eec00
271
py
Python
tutorial/listTask/models.py
PabloSuarez/API_django
522cc5b052c13c38fc7ef95353b8e3640126feaa
[ "MIT" ]
null
null
null
tutorial/listTask/models.py
PabloSuarez/API_django
522cc5b052c13c38fc7ef95353b8e3640126feaa
[ "MIT" ]
null
null
null
tutorial/listTask/models.py
PabloSuarez/API_django
522cc5b052c13c38fc7ef95353b8e3640126feaa
[ "MIT" ]
null
null
null
from django.db import models
33.875
60
0.778598
0005a7c39d8aea447086a691df1fb17b38ca23eb
927
py
Python
UAC.py
weareblahs/wsa-auto-install
0633d2b4e36ba50ddbe5b16505b8a09ff764df26
[ "MIT" ]
76
2021-10-29T23:41:26.000Z
2021-12-09T06:31:04.000Z
UAC.py
weareblahs/wsa-auto-install
0633d2b4e36ba50ddbe5b16505b8a09ff764df26
[ "MIT" ]
7
2021-11-10T19:05:26.000Z
2021-12-07T15:53:43.000Z
UAC.py
weareblahs/wsa-auto-install
0633d2b4e36ba50ddbe5b16505b8a09ff764df26
[ "MIT" ]
16
2021-11-06T06:17:58.000Z
2021-12-08T22:08:24.000Z
if __name__ == '__main__': elevate() main()
38.625
91
0.593312
0006b94d0b62d69c3ab03500298cb1fb2775bd17
629
py
Python
etikihead/urls.py
hodeld/etiki-prototype1
bcae893423519f6ddfa4f67b980066e04062d9f3
[ "MIT" ]
1
2019-08-31T18:04:39.000Z
2019-08-31T18:04:39.000Z
etikihead/urls.py
hodeld/etiki-prototype1
bcae893423519f6ddfa4f67b980066e04062d9f3
[ "MIT" ]
19
2019-12-12T01:38:49.000Z
2022-03-12T00:26:14.000Z
etikihead/urls.py
hodeld/etiki-prototype1
bcae893423519f6ddfa4f67b980066e04062d9f3
[ "MIT" ]
null
null
null
from django.urls import path from django.conf import settings from django.conf.urls.static import static from . import views app_name = 'etikihead' urlpatterns = [ path('', views.entry_mask, name='entrymask'), path('contact/', views.contact, name='contact'), path('privacy/', views.privacy, name='privacy'), path('terms/', views.legal, name='legal'), path('impressum/', views.impressum, name='impressum'), path('about/', views.about, name='about'), path('faq/', views.faq, name='faq'), path('todo/', views.todo, name='todo'), path('startinfo/', views.startinfo, name='startinfo'), # ]
26.208333
61
0.658188
0007473466f54c5bf5a586f0d058eba177c13018
1,070
py
Python
test_proj/test_tcA002.py
leeltib/vizsgamunka_ref
59dc64d499c32a548a6e83c251cf16e2787e8672
[ "MIT" ]
null
null
null
test_proj/test_tcA002.py
leeltib/vizsgamunka_ref
59dc64d499c32a548a6e83c251cf16e2787e8672
[ "MIT" ]
null
null
null
test_proj/test_tcA002.py
leeltib/vizsgamunka_ref
59dc64d499c32a548a6e83c251cf16e2787e8672
[ "MIT" ]
null
null
null
# TC002 test case - Login in with new user data - exit import data.data_tcA002 as da02 import func.func_01 as fu01 from selenium import webdriver from selenium.webdriver.common.by import By import time from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager options = Options() options.headless = True driver = webdriver.Chrome(executable_path=ChromeDriverManager().install(), options=options) driver.get("http://localhost:1667") # Wait for loading fu01.wait(driver, By.ID, "app", 2) # *** TC-A002 ************************************** username_text = test_A002() # *************************************************** # Normal run if __name__ == "__main__": print(username_text) try: assert da02.name == username_text except: print("Hiba, az ellenrz felttelnl nincs egyezs.")
23.26087
91
0.675701
000803fab8613a18bfb601cb4e0f3433d97e4dce
966
py
Python
lisc/tests/test_data_utils.py
jasongfleischer/lisc
ed30be957d7ce13ccbac51092990869840e6f176
[ "Apache-2.0" ]
1
2020-05-11T18:36:16.000Z
2020-05-11T18:36:16.000Z
lisc/tests/test_data_utils.py
jasongfleischer/lisc
ed30be957d7ce13ccbac51092990869840e6f176
[ "Apache-2.0" ]
null
null
null
lisc/tests/test_data_utils.py
jasongfleischer/lisc
ed30be957d7ce13ccbac51092990869840e6f176
[ "Apache-2.0" ]
null
null
null
"""Tests for the data utilities from lisc.""" from lisc.data.utils import * ################################################################################################### ###################################################################################################
23.560976
99
0.471014
0008876f23a1dced29f967f65132c7d09b0756dc
2,316
py
Python
repos/system_upgrade/el8toel9/actors/firewalldcheckallowzonedrifting/actor.py
tmds/leapp-repository
7c9ea115a68530eb25f5c23d3fcadd60c501bf78
[ "Apache-2.0" ]
null
null
null
repos/system_upgrade/el8toel9/actors/firewalldcheckallowzonedrifting/actor.py
tmds/leapp-repository
7c9ea115a68530eb25f5c23d3fcadd60c501bf78
[ "Apache-2.0" ]
1
2022-03-07T15:34:11.000Z
2022-03-07T15:35:15.000Z
repos/system_upgrade/el8toel9/actors/firewalldcheckallowzonedrifting/actor.py
tmds/leapp-repository
7c9ea115a68530eb25f5c23d3fcadd60c501bf78
[ "Apache-2.0" ]
null
null
null
from leapp import reporting from leapp.actors import Actor from leapp.models import FirewalldGlobalConfig, FirewallsFacts from leapp.reporting import create_report, Report from leapp.tags import ChecksPhaseTag, IPUWorkflowTag
44.538462
91
0.642055
0009620a33b624fda2004552df089e8ea26f0972
665
py
Python
eeve/eeve actions/list_dir.py
vMarcelino/eeve
7dcfa17d34480f5c120ce963680babffff8ab412
[ "Apache-2.0" ]
1
2019-10-11T18:42:48.000Z
2019-10-11T18:42:48.000Z
eeve/eeve actions/list_dir.py
vMarcelino/eeve
7dcfa17d34480f5c120ce963680babffff8ab412
[ "Apache-2.0" ]
null
null
null
eeve/eeve actions/list_dir.py
vMarcelino/eeve
7dcfa17d34480f5c120ce963680babffff8ab412
[ "Apache-2.0" ]
1
2019-10-11T18:42:49.000Z
2019-10-11T18:42:49.000Z
import os def run(path: str, return_full_path: bool = False): """Gets all files and folders from a path and stores them into $file_list Arguments: path {str} -- The path to get files and folders from Keyword Arguments: return_full_path {bool} -- True to return the full path of the file instead of just the file name (default: {False}) Returns: file_list {List[str]} -- list of files and folders """ result = os.listdir(path) if return_full_path: for i, f in enumerate(result): result[i] = os.path.join(path, f) return {'file_list': result} actions = {"list dir": run}
27.708333
124
0.627068
0009cacc81bd5d1ceb8972e6ec2ff4235cfdb2ad
11,938
py
Python
tests/test_workspaces.py
jeokrohn/wxc_sdk
e28b7e0f870d17b7f9a79ad9a4b8af221e58f8e9
[ "MIT" ]
null
null
null
tests/test_workspaces.py
jeokrohn/wxc_sdk
e28b7e0f870d17b7f9a79ad9a4b8af221e58f8e9
[ "MIT" ]
null
null
null
tests/test_workspaces.py
jeokrohn/wxc_sdk
e28b7e0f870d17b7f9a79ad9a4b8af221e58f8e9
[ "MIT" ]
1
2022-03-29T18:56:59.000Z
2022-03-29T18:56:59.000Z
""" Test for workspaces API """ # TODO: tests for authorization codes import random from collections.abc import Generator from concurrent.futures import ThreadPoolExecutor from contextlib import contextmanager from wxc_sdk.rest import RestError from wxc_sdk.all_types import * from .base import TestCaseWithLog TEST_WORKSPACES_PREFIX = 'workspace test '
43.410909
116
0.627576
000aa2371b1616577368d0ba5de43105bfebe942
1,935
py
Python
openpose/data/parse_tfrecord.py
calmisential/Pose_Estimation
f3546fcfdc81ef60708fbda5fc1eb499679fff2f
[ "MIT" ]
null
null
null
openpose/data/parse_tfrecord.py
calmisential/Pose_Estimation
f3546fcfdc81ef60708fbda5fc1eb499679fff2f
[ "MIT" ]
null
null
null
openpose/data/parse_tfrecord.py
calmisential/Pose_Estimation
f3546fcfdc81ef60708fbda5fc1eb499679fff2f
[ "MIT" ]
null
null
null
import tensorflow as tf import glob from configuration import OpenPoseCfg as cfg from openpose.data.augmentation import Transformer
34.553571
106
0.724548
000ac16fad7b0087c58e7dce0cb0032d35a1586a
209
py
Python
ex015a.py
emerfelippini/Curso_em_video-Aulas_Python
5b1d78b259732bb9bbad27cd30ce91bba77c5ef0
[ "MIT" ]
null
null
null
ex015a.py
emerfelippini/Curso_em_video-Aulas_Python
5b1d78b259732bb9bbad27cd30ce91bba77c5ef0
[ "MIT" ]
null
null
null
ex015a.py
emerfelippini/Curso_em_video-Aulas_Python
5b1d78b259732bb9bbad27cd30ce91bba77c5ef0
[ "MIT" ]
null
null
null
dia = int(input('Quantos dias alugados? ')) km = float(input('Quantos KM rodados? ')) print('Como voc ficou {} dias com ele e rodou {:.2f}KM, sua conta ficou em {:.2f}R$'.format(dia, km, (60*dia)+(0.15*km)))
52.25
122
0.645933
000bdce1c17e5a0d04aad4788cb96fae87e895ca
775
py
Python
xiaomirouter/client/ip.py
RiRomain/python-xiaomi-router
36867d077349a70678db75cf261428cdd80a0c51
[ "MIT" ]
null
null
null
xiaomirouter/client/ip.py
RiRomain/python-xiaomi-router
36867d077349a70678db75cf261428cdd80a0c51
[ "MIT" ]
null
null
null
xiaomirouter/client/ip.py
RiRomain/python-xiaomi-router
36867d077349a70678db75cf261428cdd80a0c51
[ "MIT" ]
null
null
null
""" Ip Info """
22.794118
76
0.624516
000c601e3d23cebb7bc381bcb7e6d2611c317a74
1,608
py
Python
medicine/users/views.py
walkeknow/medicine
b5f68ca0c820eb5d46852c3d72e926af59079745
[ "MIT" ]
null
null
null
medicine/users/views.py
walkeknow/medicine
b5f68ca0c820eb5d46852c3d72e926af59079745
[ "MIT" ]
null
null
null
medicine/users/views.py
walkeknow/medicine
b5f68ca0c820eb5d46852c3d72e926af59079745
[ "MIT" ]
null
null
null
from django.shortcuts import render, redirect, HttpResponseRedirect from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import UserCreationForm from django.urls import reverse # Create your views here. # def login(request): # if request.method == 'POST': # print("wow!!!!!!!!!!!!!!!!!!!!!") # messages.success(request, f'Welcome Back username!') # return render(request, 'lifecare/result.html') # else: # print("no!!!!!")
34.212766
71
0.643657
000df0f38e45fa3a6986ef9af7fbf9e539d0a092
689
py
Python
gbdxtools/images/quickbird.py
matthewhanson/gbdxtools
f07fed2ea2b8d62845f6cf83c3947d0c2a4c6daf
[ "MIT" ]
81
2016-04-05T23:32:46.000Z
2022-01-02T21:21:09.000Z
gbdxtools/images/quickbird.py
matthewhanson/gbdxtools
f07fed2ea2b8d62845f6cf83c3947d0c2a4c6daf
[ "MIT" ]
624
2016-04-06T22:22:01.000Z
2022-01-03T17:48:50.000Z
gbdxtools/images/quickbird.py
matthewhanson/gbdxtools
f07fed2ea2b8d62845f6cf83c3947d0c2a4c6daf
[ "MIT" ]
66
2016-04-13T22:45:37.000Z
2022-01-03T18:03:26.000Z
from gbdxtools.images.worldview import WorldViewImage from gbdxtools.images.geoeye01 import GeoEyeDriver from gbdxtools.images.util import vector_services_query band_types = { 'MS': 'BGRN', 'Panchromatic': 'PAN', 'Pan': 'PAN', 'pan': 'PAN' }
25.518519
93
0.690856
000efb3a697a68b72463aeb6cc6355689b2f13ed
102
py
Python
meld/plugins/move/main.py
dersal-dev/meld
bb746e8c5a2eec9f0aff5fbbfd698c6d43fa8e93
[ "MIT" ]
null
null
null
meld/plugins/move/main.py
dersal-dev/meld
bb746e8c5a2eec9f0aff5fbbfd698c6d43fa8e93
[ "MIT" ]
null
null
null
meld/plugins/move/main.py
dersal-dev/meld
bb746e8c5a2eec9f0aff5fbbfd698c6d43fa8e93
[ "MIT" ]
null
null
null
from meld import logger
17
39
0.745098
000f226aca878e3b01ee23b36d3e3744fe747d69
1,137
py
Python
fastISM/models/bpnet.py
kundajelab/fastISM
1573feccba1ad5d9f1cee508f5bb03c4aa09bb2b
[ "MIT" ]
12
2020-09-20T17:03:48.000Z
2022-03-16T06:51:52.000Z
fastISM/models/bpnet.py
kundajelab/fastISM
1573feccba1ad5d9f1cee508f5bb03c4aa09bb2b
[ "MIT" ]
5
2020-10-24T20:43:45.000Z
2022-02-25T19:40:47.000Z
fastISM/models/bpnet.py
kundajelab/fastISM
1573feccba1ad5d9f1cee508f5bb03c4aa09bb2b
[ "MIT" ]
2
2020-10-14T05:18:55.000Z
2022-02-21T07:34:14.000Z
import tensorflow as tf
34.454545
88
0.62533
000fb685fc9f26f073890df0d180e999e12bb012
801
py
Python
leetcode/108-Convert-Sorted-Array-To-Binary-Search-Tree/answer.py
vaishali-bariwal/Practice-Coding-Questions
747bfcb1cb2be5340daa745f2b9938f0ee87c9ac
[ "Unlicense" ]
25
2018-05-22T15:18:50.000Z
2022-01-08T02:41:46.000Z
leetcode/108-Convert-Sorted-Array-To-Binary-Search-Tree/answer.py
vaishali-bariwal/Practice-Coding-Questions
747bfcb1cb2be5340daa745f2b9938f0ee87c9ac
[ "Unlicense" ]
1
2019-05-24T16:55:27.000Z
2019-05-24T16:55:27.000Z
leetcode/108-Convert-Sorted-Array-To-Binary-Search-Tree/answer.py
vaishali-bariwal/Practice-Coding-Questions
747bfcb1cb2be5340daa745f2b9938f0ee87c9ac
[ "Unlicense" ]
18
2018-09-20T15:39:26.000Z
2022-03-02T21:38:22.000Z
#!/usr/bin/env python3 #------------------------------------------------------------------------------- # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None #------------------------------------------------------------------------------- # Testing
27.62069
80
0.400749
0011a0ed8ff671ab9d03956548a06f24d014ab20
600
py
Python
src/collect/migrations/0006_alter_courseinfo_name.py
YanaPIIDXer/HorseRaceInfo
af5e8734d31da6e829371209366c0c58585ab373
[ "MIT" ]
null
null
null
src/collect/migrations/0006_alter_courseinfo_name.py
YanaPIIDXer/HorseRaceInfo
af5e8734d31da6e829371209366c0c58585ab373
[ "MIT" ]
null
null
null
src/collect/migrations/0006_alter_courseinfo_name.py
YanaPIIDXer/HorseRaceInfo
af5e8734d31da6e829371209366c0c58585ab373
[ "MIT" ]
null
null
null
# Generated by Django 3.2.6 on 2021-08-14 19:48 from django.db import migrations, models
31.578947
259
0.565
0011bad4390288b5a901919fe11d0ebf83273af9
596
py
Python
tests/test_filter.py
rdemaria/xpart
35fe06eeb508991dfe1dd23685331f8347d0b603
[ "MIT" ]
1
2021-09-07T14:34:10.000Z
2021-09-07T14:34:10.000Z
tests/test_filter.py
rdemaria/xpart
35fe06eeb508991dfe1dd23685331f8347d0b603
[ "MIT" ]
null
null
null
tests/test_filter.py
rdemaria/xpart
35fe06eeb508991dfe1dd23685331f8347d0b603
[ "MIT" ]
5
2021-11-04T08:23:43.000Z
2022-03-16T10:34:23.000Z
import numpy as np import xobjects as xo import xpart as xp
25.913043
56
0.552013
001513d4c6890aca681f0ade18ed556b34353f85
4,550
py
Python
main.py
NimaVahdat/Image-Categorization
4addce895b14c0c663e3ee317ffcd802b774452b
[ "MIT" ]
null
null
null
main.py
NimaVahdat/Image-Categorization
4addce895b14c0c663e3ee317ffcd802b774452b
[ "MIT" ]
null
null
null
main.py
NimaVahdat/Image-Categorization
4addce895b14c0c663e3ee317ffcd802b774452b
[ "MIT" ]
null
null
null
from utils.loader import Loader from utils.model import DeepSNN import torch import os # %% Caltech = { "name" : "Caltech", "epochs_l1" : 20, "epochs_l2" : 100, "weight_mean" : 0.8, "weight_std" : 0.05, "lr" : (0.005, -0.0025), "in_channel1" : 4, "in_channel2" : 40, "out_channel" : 150, "k1" : 10, "k2" : 25, "r1" : 0, "r2" : 2,} train_X, train_y, test_X, test_y, weights = feature_extraction(Caltech) predicted_train, predicted_test = Classification(train_X, train_y, test_X, test_y) n = performance(train_X, train_y, predicted_train) m = performance(test_X, test_y, predicted_test) print(n) print(m) labels = ['Airplane', 'Car_side', 'Faces_easy', 'Motorbikes'] confussion_matrix(test_y, predicted_test, labels) # %% MNIST = {"name" : "MNIST", "epochs_l1":2, "epochs_l2":20, "weight_mean" : 0.8, "weight_std" : 0.05, "lr" : (0.004, -0.003), "in_channel1" : 2, "in_channel2" : 32, "out_channel" : 150, "k1" : 5, "k2" : 8, "r1" : 2, "r2" : 1,} train_X, train_y, test_X, test_y, weights = feature_extraction(MNIST) predicted_train, predicted_test = Classification(train_X, train_y, test_X, test_y) n = performance(train_X, train_y, predicted_train) m = performance(test_X, test_y, predicted_test) print(n) print(m) labels = ['0','1','2','3','4','5','6','7','8','9'] confussion_matrix(test_y, predicted_test, labels) # %% # import cv2 # import numpy as np # w1, w2 = weights # w1 = torch.reshape(w1, (160, 5, 5)) # # w2 = torch.reshape(w2, (6000, 2, 2)) # def features_pic(w, i): # # w = torch.squeeze(w) # w -= w.min() # w = (w/w.max()) * 255 # pic = cv2.resize(np.array(w), (100, 100)) # cv2.imwrite("features/feature" + str(i) + ".jpg", pic) # for i in range(len(w1)): # features_pic(w1[i], i)
28.980892
86
0.575824
0015c071b2b5e64af9f371ce3c6931d15a42c7e7
296
py
Python
python-basic/set/set_comprehension.py
nkhn37/python-tech-sample-source
e8aea7ed3d810494682b3c2dde952ddd0f7acf84
[ "MIT" ]
null
null
null
python-basic/set/set_comprehension.py
nkhn37/python-tech-sample-source
e8aea7ed3d810494682b3c2dde952ddd0f7acf84
[ "MIT" ]
null
null
null
python-basic/set/set_comprehension.py
nkhn37/python-tech-sample-source
e8aea7ed3d810494682b3c2dde952ddd0f7acf84
[ "MIT" ]
null
null
null
""" [] https://tech.nkhn37.net/python-set-comprehension/#i [] https://tech.nkhn37.net/python-comprehension/ """ data = [10, 15, 20, 25, 30, 35, 40, 45, 50, 10, 15, 20, 25, 30] # data_set = {dt for dt in data if dt % 2 == 0} print(f'data_set : {data_set}')
19.733333
63
0.655405
00198cc9e3c841bb01a56c333dd3c279b3334a56
9,789
py
Python
honeycomb/worker_bee.py
agrc/honeycomb
a4227221759541b007c2d2a8dcfca5a40192eeff
[ "MIT" ]
1
2018-06-07T13:17:40.000Z
2018-06-07T13:17:40.000Z
honeycomb/worker_bee.py
agrc/honeycomb
a4227221759541b007c2d2a8dcfca5a40192eeff
[ "MIT" ]
24
2017-08-28T19:53:15.000Z
2022-03-28T21:36:37.000Z
honeycomb/worker_bee.py
agrc/honeycomb
a4227221759541b007c2d2a8dcfca5a40192eeff
[ "MIT" ]
null
null
null
#!/usr/bin/env python # * coding: utf8 * ''' worker_bee.py A module that contains logic for building traditional image-based caches. ''' import os import socket import time from os.path import join, dirname, realpath from shutil import rmtree import pygsheets from datetime import date import arcpy from . import config, settings, update_data from .messaging import send_email spot_cache_name = 'spot cache' error_001470_message = 'ERROR 001470: Failed to retrieve the job status from server. The Job is running on the server, please use the above URL to check the job status.\nFailed to execute (ManageMapServerCacheTiles).\n' # noqa
42.934211
227
0.635611
001dcd97b7d4ca23335c414e226aaa113e8d7e20
4,418
py
Python
src/smooth.py
DQSSSSS/FluidSimulation
92ec2b45bc3ebaf39eeeec37f07fb7cc2988ce6d
[ "MIT" ]
null
null
null
src/smooth.py
DQSSSSS/FluidSimulation
92ec2b45bc3ebaf39eeeec37f07fb7cc2988ce6d
[ "MIT" ]
1
2021-11-12T03:16:59.000Z
2021-11-12T04:47:50.000Z
src/smooth.py
DQSSSSS/FluidSimulation
92ec2b45bc3ebaf39eeeec37f07fb7cc2988ce6d
[ "MIT" ]
null
null
null
import taichi as ti PI = 3.1415926 # http://www.glowinggoo.com/sph/bin/kelager.06.pdf if __name__ == '__main__': ti.init(arch=ti.cpu, debug=True) test()
27.104294
125
0.4579
0020df4e44bafa386b7d0a3f1bc4997c91a46d31
747
py
Python
Ezan.py
Jandro46t/Python
4f604215df085ad18dabfa52fe7863bad97863ab
[ "Apache-2.0" ]
2
2021-04-16T11:58:39.000Z
2021-04-16T11:58:39.000Z
Ezan.py
Jandro46t/Python
4f604215df085ad18dabfa52fe7863bad97863ab
[ "Apache-2.0" ]
null
null
null
Ezan.py
Jandro46t/Python
4f604215df085ad18dabfa52fe7863bad97863ab
[ "Apache-2.0" ]
null
null
null
import requests import json url_sehir = "https://ezanvakti.herokuapp.com/sehirler/2" r = requests.get(url_sehir) j = r.json() sehir_adi = input("ehir:") ilce_adi = input("le:") for sehir in j: if sehir_adi == sehir["SehirAdi"]: ID = sehir["SehirID"] print(ID) url_ilce = "https://ezanvakti.herokuapp.com/ilceler/{}".format(ID) re = requests.get(url_ilce) je = re.json() for ilce in je: if ilce_adi == ilce["IlceAdi"]: PD = ilce["IlceID"] print(PD) url_vakit = "https://ezanvakti.herokuapp.com/vakitler/{}".format(PD) res = requests.get(url_vakit) jes = res.json() muzo = jes[0] for vakit in muzo: print(vakit,":",muzo[vakit]) input("kmak iin herhangi bir tua bas")
29.88
69
0.634538